You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(captcha): fail closed when the DOM rescan cannot disprove a tree-observed challenge
The visibility recheck added for all-filter accessibility-tree reads cleared
the challenge whenever detectChallengeDialogInPage found no visible dialog.
That scan is not authoritative: it was blind to open shadow roots (which the
tree pierces on LinkedIn/Bilibili), and an injection failure was
indistinguishable from a confirmed-hidden dialog — so a real challenge could
be discarded and the CAPTCHA gate bypassed by the next mutation.
- detectChallengeDialogInPage now scans open shadow roots (bounded depth),
walks visibility through shadow hosts, resolves aria-labelledby against the
element's root node, and reports a matching-but-hidden dialog separately as
hiddenChallenge.
- _detectChallengeDialogBeforeMutation exposes challengeHidden and reports
inspectionComplete:false when no frame was actually inspected.
- _observeCaptchaChallenge clears a tree-observed challenge only when the
rescan completed AND positively confirmed the dialog hidden; "not found"
and inconclusive scans keep the gate armed.
Fixes the two fail-open test regressions on this branch (unsupported-Arkose
routing and manual-completion batch) and addresses the P1 review finding.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments