Skip to content

fix: avoid claiming embedded Turnstile is solved - #531

Open
dannyward630 wants to merge 1 commit into
D4Vinci:devfrom
dannyward630:fix/cloudflare-embedded-verdict-525
Open

dannyward630 wants to merge 1 commit into
D4Vinci:devfrom
dannyward630:fix/cloudflare-embedded-verdict-525

Conversation

@dannyward630

Copy link
Copy Markdown

Embedded Turnstile widgets can remain on pages after solving, so their presence cannot establish that the challenge is cleared. Make _challenge_cleared rely only on detected challenge content and log embedded results as unverifiable. Add sync and async regression coverage.

Proposed change

Embedded Turnstile scripts can remain in the page whether a challenge is solved or not. The previous embedded-challenge shortcut therefore reported success without evidence. This change treats a challenge as cleared only when no Cloudflare challenge is detected, and reports embedded solver outcomes as unverifiable while returning the page unchanged. Sync and async regression tests cover this behavior.

Type of change:

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Additional information

Validation:

  • Focused Cloudflare solver tests: 18 passed.
  • Pre-commit checks: passed.
  • Full non-browser suite: 1,035 passed.
  • Async non-browser suite: 1,070 passed; 2 unrelated response-handling tests failed with a parser serialization UnicodeDecodeError.
  • Browser suite: 168 passed; 4 unrelated failures (one auxclick expectation and three Windows PermissionError vs IsADirectoryError expectations). Cloudflare readiness cases passed.

AI disclosure: Codex (GPT-6) generated and edited the implementation and regression tests, ran the validations above, and drafted this description. The patch has not received human review yet.

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doc-strings.

Embedded Turnstile widgets can remain on pages after solving, so their presence cannot establish that the challenge is cleared. Make _challenge_cleared rely only on detected challenge content and log embedded results as unverifiable. Add sync and async regression coverage.

This branch has not been deployed

No deployments
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