Skip to content

Conversation

@ArcticFoxPro
Copy link
Owner

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

To fix the problem, we need to parse the repository URL and check its host value explicitly. This ensures that the host is correctly identified and prevents any malicious URLs from being miscategorized. We will use the URL class available in modern JavaScript to parse the URL and extract the host.

  1. Import the URL class if necessary.
  2. Parse the repository URL using the URL class.
  3. Check the host value against the allowed hosts ("github.com" and "gitlab.com").
  4. Update the repoType based on the parsed host value.

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 0376719 into main Feb 2, 2025
2 checks passed
@ArcticFoxPro ArcticFoxPro deleted the alert-autofix-9 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