Skip to content
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

Fix code scanning alert no. 20: Cross-site scripting #13

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

Maneppagolmanju
Copy link
Owner

Fixes https://github.com/Maneppagolmanju/SixtSecurityShepherd/security/code-scanning/20

To fix the cross-site scripting vulnerability, we need to ensure that the user input (searchTerm) is properly sanitized and encoded before being included in the HTML response. The best way to achieve this is by using a library that provides contextual output encoding for HTML.

We will use the StringEscapeUtils class from the Apache Commons Text library to encode the searchTerm before including it in the HTML response. This will ensure that any potentially dangerous characters in the user input are properly escaped.

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>
@Maneppagolmanju Maneppagolmanju marked this pull request as ready for review November 26, 2024 11:34
@Maneppagolmanju Maneppagolmanju merged commit f3bf713 into dev Nov 26, 2024
11 of 13 checks passed
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