fix(annaabi): name the Cloudflare challenge instead of emitting a bare 403 - #557
Merged
Conversation
Every email_scan validator is async, but curl_cffi's session API blocks and the email orchestrator fans out up to 25 modules on one event loop, so a direct call would stall every module in flight. Delegates to the existing impersonate_request in a worker thread, keeping the session cache, cookie warm-up, proxy rotation and the -t timeout in one place.
…e 403 httpx receives a managed challenge for every request, so the module reported an unexplained 403. Route it through the impersonating transport, which may be all it needs where the site is reachable, and name the challenge when it is not. The verdict logic itself is verified through a real browser: test@gmail.com returns the exact taken marker and unregistered addresses the exact free one.
Collaborator
|
I investigated these modules a few days ago when they were consistently failing for me too. Impersonation did not help, but now the modules work for me again all of a sudden. I am in favour of the improved error message, but I'm not sure if the impersonation helps at all. |
Owner
|
@kristoisberg if this works for you, like if you are able to get a +ve/-ve hits in this test then it's fine, as I am unable to test it properly because this website is blocked in my region. Anyways about the impersonation I don't think it matters what is used here, because httpx is brittle in these cases as we saw in all the recent fixes we had to migrate from httpx to curl_cffi but we didn't have to do vice versa. So I think using impersonation is just being safe! |
kristoisberg
approved these changes
Aug 9, 2026
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.
The module reported a bare
Unexpected response status: 403for every address, which reads like a module bug. It is a Cloudflare managed challenge —cf-mitigated: challengeon every request, confirmed from two different countries and across httpx, curl_cffi and urllib.Two changes: the module moves to the impersonating transport, which may be all it needs where the site is reachable, and the challenge is named when it is not.
The verdict logic is verified, not assumed
The challenge was cleared by hand in a real browser and both markers still match exactly:
So this is a network wall rather than rotted parsing, and the module should work unchanged wherever the site talks to an HTTP client.
Not verified
It has not run end-to-end from here — the challenge is served to every HTTP client regardless of region, so from my locations it returns the named error rather than a verdict. What is verified is the verdict logic, against real server responses captured once the challenge was cleared.
This mirrors #547, which does the same for the
user_scantwin.Depends on #528, whose commit is included here until it merges — review only the module file.