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. 2: DOM text reinterpreted as HTML #274

Closed
wants to merge 1 commit into from

Conversation

rkettelerij
Copy link
Collaborator

Fixes https://github.com/PDOK/gokoala/security/code-scanning/2

To fix the problem, we need to ensure that any user input is properly sanitized or escaped before being used in the DOM. In this case, we should escape the selectedStyle variable before using it to construct the URL. This can be done using a function that ensures any special characters are properly encoded.

We will use JavaScript's encodeURIComponent function to escape the selectedStyle and selectedProjection values before using them in the URL.

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>
@rkettelerij rkettelerij closed this Jan 6, 2025
@rkettelerij rkettelerij deleted the alert-autofix-2a branch January 6, 2025 19:48
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