在微服务体系结构中,我使用restTemplate进行同步的服务间通信.
当我们完成Veracode扫描时,我们将得到getForEntity方法中的Server-Side Request Forgery (SSRF) (CWE ID 918)。
restTemplate.getForEntity(URL, Entity.class);不知道为什么我会有这个SSRF问题?
解决这个问题的可能方法是什么?
发布于 2021-06-03 09:30:29
我已经解决了这个问题,在使用UriComponents之前先使用restTemplate构建URL。
UriComponents uriComponents = UriComponentsBuilder.newInstance()
.scheme("http").host("www.yourdomain.com").path("/yourPath").build();请参考此链接使用UriComponents https://www.baeldung.com/spring-uricomponentsbuilder
https://stackoverflow.com/questions/65679327
复制相似问题