fix: use proper URL parsing for GitHub API domain#1039
fix: use proper URL parsing for GitHub API domain#1039mergify[bot] merged 1 commit intopython-wheel-build:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdded an import from urllib.parse and changed GitHub rate-limit detection in RetryHTTPAdapter.send to parse the request URL and compare its hostname to "api.github.com" (using urlparse(request.url).hostname == "api.github.com") instead of using a substring check. This narrows which 403 responses are classified as GitHub rate limiting. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
@mergify rebase |
Replace substring check with urlparse hostname comparison to prevent potential bypass via crafted URLs. Resolves CodeQL alert py/incomplete-url-substring-sanitization (CWE-20): https://github.com/python-wheel-build/fromager/security/code-scanning/1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Martin Prpič <mprpic@redhat.com>
|
Deprecation notice: This pull request comes from a fork and was rebased using |
✅ Branch has been successfully rebased |
7c6324a to
22be37f
Compare
@LalatenduMohanty Why run this before every merge? (also it seems this behavior will be deprecated in a few months; see above) |
Pull Request Description
What
Replace substring check with urlparse hostname comparison to prevent potential bypass via crafted URLs. Resolves CodeQL alert py/incomplete-url-substring-sanitization (CWE-20):
https://github.com/python-wheel-build/fromager/security/code-scanning/1
Why
Resolves https://github.com/python-wheel-build/fromager/security/code-scanning/1 while still being a minimal, unobtrusive change.