How I Bypassed a CAPTCHA Implementation Without Breaking a Sweat
The application's CAPTCHA validation logic used a conditional that skipped verification when the token was falsy, allowing an attacker to bypass CAPTCHA and trigger email notifications without solving the challenge.
medium.com
Published on medium.com
Hey y’all, it’s been a minute since I posted anything to do with web security. Well, you’re in luck, because today I’m dropping something I’ve observed a couple of times in the wild and thought was worth writing about, because you might come across it too.
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 conditional used a logical AND that short-circuited when the token was falsy, so the validation function was never called.
Impact
An attacker could bypass CAPTCHA and abuse the email notification system, potentially leading to resource exhaustion or email service disruption.
What the attacker needed
Unauthenticated access to the API endpoint
The fix
The fix was to use a logical OR condition that checks if the token is missing or invalid, ensuring validation always occurs.
How it was found
- Identify the API endpoint that sends email notifications and requires a CAPTCHA token.
- Send a request with a falsy value (e.g., null or false) as the CAPTCHA token parameter.
- Observe that the request succeeds and an email is sent without CAPTCHA verification.
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 test to prove you are human. The code checked the CAPTCHA token in a way that could be tricked by sending an empty or false value, so the check was skipped and the action (sending an email) happened anyway.
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.