Skip to content

Conversation

@ArcticFoxPro
Copy link
Owner

Potential fix for https://github.com/ArcticFoxPro/QQVersionListTool-WeChatMiniProgram/security/code-scanning/8

To fix the problem, we need to parse the URL and check the host component explicitly rather than using a substring check. This ensures that the host is correctly identified and validated against a whitelist of allowed hosts.

  1. Parse the URL to extract the host component.
  2. Check if the host matches "github.com" or "gitlab.com".
  3. Update the repoType assignment to use the parsed host for validation.

We will use the URL constructor available in modern JavaScript to parse the URL and extract the host component.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

… sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@ArcticFoxPro ArcticFoxPro marked this pull request as ready for review February 2, 2025 19:47
@ArcticFoxPro ArcticFoxPro merged commit ffc173a into main Feb 2, 2025
2 checks passed
@ArcticFoxPro ArcticFoxPro deleted the alert-autofix-8 branch February 3, 2025 06:19
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.

2 participants