Repository navigation
fix: match browser CORS header case and whitespace rules - #171
Open
arpitkjaiswal wants to merge 1 commit into
Open
arpitkjaiswal wants to merge 1 commit into
arpitkjaiswal wants to merge 1 commit into
Conversation
shuvonsec
force-pushed
the
main
branch
3 times, most recently
from
October 8, 2026 10:46
9efc2d0 to
fb51a54
Compare
Member
|
Thanks @arpitkjaiswal. Keeping this open for now — it needs a rebase before it can land. GitHub shows it CONFLICTING against Please:
Once it's rebased and scoped to the CORS change, I'll review and land it. |
Compare ACAO exactly with the sent origin and accept only lowercase true for ACAC. Strip HTTP optional whitespace (space/tab), preserving invalid non-HTTP whitespace so it cannot create false-positive findings. Cover ordinary, null and wildcard origins, credentials casing, whitespace, and CLI JSON output/exit status with mocked responses.
arpitkjaiswal
force-pushed
the
fix/cors-header-case-sensitivity
branch
from
October 23, 2026 18:34
2d82869 to
0734a07
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The CORS classifier reports credentialed origin reflection for header values that browsers reject. For example,
Origin: https://evil.examplewithAccess-Control-Allow-Origin: https://Evil.ExampleandAccess-Control-Allow-Credentials: trueincorrectly produces a CRITICAL finding. It also acceptsTrueas a credentials value and strips non-HTTP whitespace.truefor credentials.Reference: https://fetch.spec.whatwg.org/#cors-check
Scope
Rebased onto upstream
mainat16dabf0cea8a43ad9d42733283e0fd8ed74313c0. The PR now contains one commit and only two changed files:bughunter/tools/cors_scanner.py— CORS header comparisons; existing executable permission preserved.tests/test_cors_scanner.py— regression coverage.Type
Test Plan
python -m pytest tests/ -q: 1,160 passed on Python 3.12.14, with dependencies installed fromrequirements.txt.git diff --checkpasses.GitHub Actions for the updated commit currently reports
action_requiredwith no jobs started: https://github.com/awarexone/Agentic-Bug-Hunter/actions/runs/40004391788. Maintainer action is needed before hosted CI can run.Related Issue
Addresses the requested rebase and CORS-only scope in #171 (comment).