Skip to content

Conversation

guruh46
Copy link
Owner

@guruh46 guruh46 commented Nov 27, 2024

Fixes https://github.com/guruh46/vscode-gitlens/security/code-scanning/2

To fix the problem, we need to parse the URL and check its host value against a whitelist of allowed hosts. This ensures that the check handles arbitrary subdomain sequences correctly and prevents malicious URLs from bypassing the security check.

  1. Parse the URL using the url module to extract the host.
  2. Check if the host is in a predefined list of allowed hosts.
  3. Update the getHeaders method to use this new check.

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>
@guruh46 guruh46 marked this pull request as ready for review November 27, 2024 11:26
@guruh46 guruh46 merged commit 22479a8 into main Nov 27, 2024
6 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