Skip to content

fix(scrape): scan full html for CF challenge markers, not an 80KB prefix#216

Merged
us merged 1 commit into
mainfrom
fix/cf-marker-fullscan
Jul 6, 2026
Merged

fix(scrape): scan full html for CF challenge markers, not an 80KB prefix#216
us merged 1 commit into
mainfrom
fix/cf-marker-fullscan

Conversation

@us

@us us commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Follow-up to #214. Live re-test showed barcodelookup.com STILL leaked the challenge as success:true.

Root cause of the miss: #214 scanned only the first 80KB, but on the real page the challenge markers sit near the end of the body — /cdn-cgi/challenge-platform/ @ byte 113706, _cf_chl_opt @ 115139 of a 118KB page. The #214 unit test masked this by placing the marker in <head>.

Fix: scan the full html with a case-sensitive substring match (these are fixed-case CF tokens, so no lowercased-copy allocation per scrape), and fix the regression test to place the marker past 80KB. Verified against the captured live response body (_cf_chl_opt / challenge-platform both match case-sensitively). crw-crawl suite green; pre-commit passed.

Will re-verify on live barcodelookup.com after deploy.

The prior CF Turnstile fix scanned only the first 80KB, but on the real
barcodelookup.com page the challenge markers sit near the END of the body
(/cdn-cgi/challenge-platform/ @113706, _cf_chl_opt @115139 of a 118KB page) —
so the interstitial still leaked as success:true in prod. The earlier unit
test masked this by placing the marker in <head>.

Scan the full html with a case-sensitive substring match (fixed-case CF
tokens, no lowercase allocation needed), and fix the regression test to place
the marker past 80KB. Verified against the captured live response body.

Fixes #350
@us us merged commit 99fe2b2 into main Jul 6, 2026
8 of 9 checks passed
@us us deleted the fix/cf-marker-fullscan branch July 6, 2026 22:41
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