OpenFeign / feign

Feign makes writing java http clients easier
Apache License 2.0
9.51k stars 1.93k forks source link

Fix code scanning alert no. 12: Cross-site scripting #2611

Closed velo closed 1 month ago

velo commented 1 month ago

Fixes https://github.com/OpenFeign/feign/security/code-scanning/12

To fix the cross-site scripting vulnerability, we need to ensure that any user input included in the response is properly sanitized or encoded. In this case, we can use the HtmlUtils.htmlEscape method from the org.springframework.web.util package to encode the user inputs before concatenating them into the response string. This will prevent any malicious scripts from being executed if the response is rendered in an HTML context.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.