fix: stop CSP allow-lists triggering challenge detection (#264) - #266
Open
ankitranjan7 wants to merge 1 commit into
Open
fix: stop CSP allow-lists triggering challenge detection (#264)#266ankitranjan7 wants to merge 1 commit into
ankitranjan7 wants to merge 1 commit into
Conversation
isChallengeResponse matched challenge markers against every response header, so any site whose CSP names cdnjs.cloudflare.com or google.com/recaptcha (HN, among many) was classified as a challenge: two wasted impit fetches and a misleading FETCH_BLOCKED for a page that was never blocked. Header evidence is now limited to headers that describe this response (server, cf-mitigated, cf-chl-*, x-datadome*, set-cookie), and a 200 needs body evidence — headers alone never prove a challenge on a served page. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
🟢 No documentation gap found — medium confidenceThe automated review found no documentation gap in the supplied changes. This review is advisory and does not block merging. |
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.
Fixes #264.
isChallengeResponsebuilt its evidence string from every response header, so any site whosecontent-security-policyallow-listscdnjs.cloudflare.comorgoogle.com/recaptchamatchedchallengeMarkers.news.ycombinator.comreturned a healthy 200 with the full HTML, got classified as a challenge, ran the whole impit ladder for nothing, and ended inFETCH_BLOCKED.Change
server,cf-mitigated,cf-chl-*,x-datadome*,set-cookie. CSP/report-to/linkare third-party allow-lists and prove nothing.200now needs body evidence.server: cloudflareon a served page is not a challenge — real interstitials say "Just a moment" in the body, which still matches.Verification
npx vitest run src/fetch/→ 22 passed;npm run typecheckclean. New cases cover the CSP false positive, headers-only 200, and that 403 +server: cloudflarestill classifies.🤖 Generated with Claude Code