Repository navigation
fix: check browser sidecar pages for a challenge and stop flagging Cloudflare's passive script - #64
Merged
Merged
Conversation
…oudflare's passive script
Owner
Author
|
Review: OK to merge.
|
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.
Two linked problems in the anti-bot ladder.
Sidecar answers were never checked (#48). A page returned by the browser sidecar went straight to readability: no status check, no
detectChallenge. If the browser also ended on the block page, it was stored as the article.solver.fetchcall sites now returnerrChallengeunless the status is 2xx anddetectChallengefinds nothing.Ordinary Cloudflare pages looked like challenges (#29).
/cdn-cgi/challenge-platform/was a marker, but Cloudflare's passivejsdscript puts that path into normal 200 pages. With the new check above, a page the browser really solved would have been thrown away, so both are fixed together._cf_chl_opt, which only real interstitials carry.Tests: the existing 200-interstitial case now uses a real interstitial body; new cases for a large article carrying the
jsdscript (challengeNone), a sidecar article carrying it (returned as the page), and a sidecar block page (403 and 200 interstitial, botherrChallenge).Tested with gofmt,
go vet ./...andgo test -race ./...against a migratedpostgres:16(no test skipped).Closes #48
Closes #29