Race Conditions Are Not Just for Bypassing Plan Limits!!
The email verification endpoint used a POST request and did not properly tie the verification token to the email address being changed. By racing a request that changed the account email against a request that submitted a valid verification token, an attacker could get an arbitrary email address marked as verified.
Published on medium.com
It’s been a long time since I shared tips 🤧 but inshallah today I will try my best to give you something useful for your bug hunting journey.
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 verification step checked the token but not which email address it was issued for, so a concurrent email change let the token apply to a different address.
Impact
An attacker could mark an email address they do not control as verified, which may unlock features gated behind verification and enable further abuse.
What the attacker needed
A free account; a valid verification token; ability to send concurrent requests
The fix
The verification token should be bound to the specific email address it was issued for and checked atomically, so a concurrent email change cannot make it apply to another address.
How it was found
- Create an account without verifying the email.
- Go through the normal verification flow and obtain a valid verification link or token.
- Send a request to change the account email to a target address.
- At the same time, send the verification request with the valid token.
- Observe that the new email address becomes verified.
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 race condition is when two actions happen at almost the same moment and the program handles them in an order it did not expect. Here, one request changed the account's email while another submitted a valid verification code, so the server verified the new address without the attacker ever controlling it. That lets someone claim an email they do not own.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.