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. 1: Incomplete URL substring sanitization #273

Closed
wants to merge 1 commit into from

Conversation

rkettelerij
Copy link
Collaborator

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

To fix the problem, we need to parse the URL and check the host value against a whitelist of allowed hosts. This ensures that the check handles arbitrary subdomain sequences correctly and prevents bypassing the check by embedding the allowed host in an unexpected location.

  1. Parse the URL to extract the host component.
  2. Compare the host component against a whitelist of allowed hosts.
  3. Update the code in tests/cypress/support/commands.ts to implement this fix.

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 marked this pull request as ready for review January 6, 2025 19:40
@rkettelerij rkettelerij closed this Jan 6, 2025
@rkettelerij rkettelerij deleted the alert-autofix-1 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