Diagnostic playbook
Insecure CAPTCHA: two-step password change and hardcoded bypass values
Web / Captcha Bypass / Anti-Automation
Knowledge identity
Definition and taxonomy
Summary
A two-step CAPTCHA-protected password change is bypassable: the second step omits or trusts a client-supplied CAPTCHA-passed indicator, and at high level a hardcoded response string bypasses the check.
Severity rationale
Demonstrated changing the admin password without solving the CAPTCHA: (low) skipping to step 2 with no CAPTCHA re-check, (medium) setting a client-controlled passed_captcha flag, (high) using the hardcoded response value 'hidd3n_valu3'. Password was restored to the seeded value after each proof via the same bypasses.
Aliases
CAPTCHA defeat, reCAPTCHA bypass, two-step flow abuse
Standards
CWE-799 CAPEC-608 A07:2021-Identification and Authentication Failures
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
1. First Signal
What should make an agent suspicious
Symptoms
Sending step=2 directly changes the password with no CAPTCHA; medium accepts passed_captcha=true from the client; high accepts g-recaptcha-response=hidd3n_valu3; the UI may hide feedback when no reCAPTCHA key is configured, but the DB is updated (silent success).
Prerequisites
Authorized lab session. Multi-step flow where a CAPTCHA gate exists on an early step but not on the final action, or where a constant bypass value is accepted.
2. Recognition Logic
How to recognize this next time
Inspect multi-step flows: the CAPTCHA is usually only checked on step 1, so post directly to the final step. If a flag like passed_captcha is in a hidden input, send it manually. Search source comments for hardcoded bypass values.
3. Diagnostic Procedure
Safe checks, in order
- Confirm authorized scope. 2. Read the multi-step logic in source. 3. POST directly to the final step. 4. If a passed_captcha flag exists, supply it. 5. Look for hardcoded response constants. 6. Verify the change via the DB and restore the seeded value immediately. 7. Record which step lacks validation.
4. Proof
Evidence
DVWA captcha: low step=2 POST changed admin password to md5('testpass123') with no CAPTCHA (confirmed via DB); medium restore used passed_captcha=true successfully; high restore used g-recaptcha-response=hidd3n_valu3 successfully. Seeded hash restored after each.
5. Controls
Negative checks
Without the bypass parameter (e.g., no passed_captcha at medium), the change is blocked; step 1 with a fake captcha is rejected. At all levels the CAPTCHA itself is never actually solved in the proofs.
6. Avoid Bad Memory
False positives and traps
A missing reCAPTCHA key hides UI feedback but does not stop the backend processing - verify via the database, not the page text.
7. Why It Matters
Impact
Automated password changes without human verification; combined with CSRF this enables forced credential changes.
8. Why It Happened
Root cause
The CAPTCHA is not re-validated on the final state-changing step; medium trusts a client-supplied passed flag; high compares against a hardcoded constant instead of the provider's verification.
9. Fix
Remediation and prevention
Validate the CAPTCHA on the server for every state-changing step. Never trust client-supplied passed flags. Verify reCAPTCHA against the provider API with a server-side secret; do not hardcode bypass values.
10. Re-test
Verification steps
- After fix, replay the step-2-only POST and confirm denial. 2. Confirm passed_captcha and hidd3n_valu3 are ignored. 3. Confirm only a server-verified CAPTCHA completes the change. 4. Regression tests.
Reference
Tools and sources
Tools used
curl for POSTs, docker exec for read-only source review and DB hash verification
References
OWASP CAPTCHA; CWE-799; CAPEC-608
Intelligence
Products and history
Technologies
PHP, Google reCAPTCHA
Affected products / versions
DVWA (Damn Vulnerable Web Application) current master
History
First documented in DVWA captcha module in the 2026-08 benchmark run.
Exploit knowledge
Variants and references
Attack surface
Change password form on /vulnerabilities/captcha/ with step, passed_captcha, and g-recaptcha-response parameters
Exploit maturity
proof-of-concept
Known variants
Two-step flow without server-side captcha re-check on the final step (low), client-controlled passed_captcha flag (medium), hardcoded response value (high), missing CAPTCHA key leaving the flow unvalidated
Defensive signatures
Multi-step forms where the final step lacks a CAPTCHA validation, hidden flags that indicate captcha success but are supplied by the client, hardcoded response strings or DEV-NOTE comments in source
Reproduction commands
Low (skip step 2, no captcha): curl -s -b $JAR -d 'Change=Change&step=2&password_new=testpass&password_conf=testpass' http://127.0.0.1:4280/vulnerabilities/captcha/ Medium (client-controlled flag): curl -s -b $JAR -d 'Change=Change&step=2&password_new=testpass&password_conf=testpass&passed_captcha=true' http://127.0.0.1:4280/vulnerabilities/captcha/ High (hardcoded value): curl -s -b $JAR -d 'Change=Change&g-recaptcha-response=hidd3n_valu3&password_new=testpass&password_conf=testpass' http://127.0.0.1:4280/vulnerabilities/captcha/ Always restore the seeded password afterwards.
Exploit references
No external references stored; all evidence from the authorized local lab.
Case provenance