When CAPTCHA Fails Silently: A Hidden Authentication Logic Bug
The login endpoint did not enforce CAPTCHA before checking credentials, so even without a valid CAPTCHA the server returned distinct error messages for a wrong password versus an unregistered username. An attacker could use these differences to enumerate valid usernames and then attempt brute-force attacks without solving the CAPTCHA.
medium.com
Published on medium.com
This write-up is a reminder that when it comes to security testing, what you see on the surface isn’t always what’s happening under the hood.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the backend performed credential validation before verifying the CAPTCHA, and returned distinct error messages for invalid username versus invalid password.
Impact
An attacker could enumerate valid usernames and then attempt brute-force attacks without solving the CAPTCHA, though the text does not show a successful account takeover.
What the attacker needed
Access to the login page; ability to intercept and modify requests
The fix
The CAPTCHA should be validated before any credential check, and the login response should use a single generic error message for all failures.
How it was found
- Solve the CAPTCHA on the login page and intercept the login request.
- Send the request to Burp Repeater and replay it without a valid CAPTCHA.
- Observe that the response includes a password-specific error for the username admin along with a CAPTCHA error.
- Change the username parameter from admin to admin1 and observe a different error saying the username is not registered.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A CAPTCHA is a puzzle meant to prove a human is logging in, blocking automated guessing. Here the server checked the username and password first and only then complained about the CAPTCHA, so an attacker could keep guessing. The different error messages also revealed which usernames exist.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.