簡體   English   中英

獲取服務器端請求偽造 (SSRF) (CWE ID 918) restTemplate.getForEntity

[英]Getting Server-Side Request Forgery (SSRF) (CWE ID 918) restTemplate.getForEntity

我正在使用restTemplate在微服務架構中進行同步服務間通信。

當我們完成Veracode掃描時,我們在getForEntity方法中獲取Server-Side Request Forgery (SSRF) (CWE ID 918)

restTemplate.getForEntity(URL, Entity.class);

不知道為什么我會收到這個SSRF問題?
對此有什么可能的解決方法?

我已經通過在 restTemplate 中使用之前使用 UriComponents 構建 URL 解決了這個問題。

UriComponents uriComponents = UriComponentsBuilder.newInstance()
  .scheme("http").host("www.yourdomain.com").path("/yourPath").build();

請參考此鏈接以使用 UriComponents https://www.baeldung.com/spring-uricomponentsbuilder

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM