Skip to content

Potential fix for code scanning alert no. 4: Incomplete URL substring sanitization - #257

Draft
jkterry1 wants to merge 1 commit into
mainfrom
alert-autofix-4
Draft

Potential fix for code scanning alert no. 4: Incomplete URL substring sanitization#257
jkterry1 wants to merge 1 commit into
mainfrom
alert-autofix-4

Conversation

@jkterry1

@jkterry1 jkterry1 commented Aug 2, 2026

Copy link
Copy Markdown
Member

Potential fix for https://github.com/Farama-Foundation/Stable-Retro/security/code-scanning/4

Use exact hostname checks (or boundary-safe subdomain checks) on the parsed host, instead of raw suffix matching on netloc.

Best fix here without changing intended behavior:

  • In third-party/gtest/googlemock/scripts/upload.py, inside _GuessBase, after urllib.splituser(netloc), normalize host by removing any port and lowercasing it.
  • Replace netloc.endswith("svn.collab.net") with a boundary-safe check:
    • host == "svn.collab.net" or host.endswith(".svn.collab.net")
  • Keep existing behavior for URL construction unchanged (continue using netloc when building URLs), so functionality remains the same except the host classification is now correct and robust.

No new dependencies are needed.

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>
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