Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2024
Merged

Conversation

velo
Copy link
Member

@velo velo commented Oct 21, 2024

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.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@velo velo merged commit ca15b95 into master Oct 21, 2024
3 of 5 checks passed
@velo velo deleted the alert-autofix-12 branch October 21, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant