Race Condition on Change Email Leads to Arbitrary Email Forgery
A race condition in the email change function allowed an attacker to set a victim's unregistered email as pending while the confirmation email was sent to both the victim and the attacker's secondary email. The attacker could then click the verification link sent to their own email and claim the victim's email address.
Published on medium.com
In this post, I will show you how I discovered a vulnerability that allows a malicious user to change their email to an unregistered email that belongs to someone else & perform the email verification without consent from the legitimate owner of the email. The attack can be done by sending multiple requests in…
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 a race window between when the confirmation email recipient is determined and when the email body (including the verification link) is generated, allowing another thread to change the pending email in between.
Impact
Attackers could change their account email to an unregistered address they do not own, preventing the legitimate owner from registering that email and causing spam to the owner; the report notes the vendor classified it as informational.
What the attacker needed
Attacker account with verified email; victim email not registered on the site; secondary email for attacker; Burp Suite with Turbo Intruder
The fix
The report suggests using atomic operations (database transactions, locking, mutexes) or parallel-safe design to eliminate the race window; it does not state that the issue was fixed.
How it was found
- Create an attacker account with a verified email.
- Find a victim email that has never registered on the site.
- Prepare a secondary email for the attacker that has never registered.
- Log in as the attacker and go to the email settings page.
- Intercept the email change request and send it to Turbo Intruder.
- Configure a single-packet attack script to send two requests in parallel with different emails.
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 happens when a website handles two requests at the same time and they interfere with each other. Here, the attacker sent two email-change requests almost simultaneously, one with the victim's email and one with their own. Because the server mixed up which email to send the confirmation to, the attacker received a valid link to verify the victim's address.
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.