From Hidden Parameter to Account Takeover
The change phone number form lacked a CSRF token, but the server validated requests using a hidden token parameter that could be reused if not in consecutive requests. An attacker could bypass this validation by alternating leaked tokens, enabling a CSRF attack to change a victim's phone number and potentially take over their account.
While analyzing a web application’s “Change Phone Number” functionality, I noticed that there was no CSRF token present in the form or headers. This indicated that the application might be vulnerable to Cross-Site Request Forgery (CSRF) attacks.
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 server used a hidden token for CSRF protection but allowed token reuse as long as the same token was not used in consecutive requests, instead of requiring a unique, unpredictable token per request.
Impact
An attacker could perform a CSRF attack to change a victim's phone number, which could lead to account takeover.
What the attacker needed
Victim is logged in; attacker can lure victim to a malicious page; attacker has leaked token values
The fix
The application should use a unique, random token for each request and validate the Origin and Referrer headers, among other CSRF defences.
How it was found
- Observe that the change phone number request has no CSRF token.
- Craft a CSRF proof-of-concept and note that it fails.
- Rule out Referer and Origin header validation.
- Use Param Miner to brute-force hidden parameters and discover a hidden token parameter.
- Find leaked token values in Burp Suite history.
- Alternate between two leaked tokens across requests to bypass validation and successfully change the phone number.
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.
This report describes a CSRF flaw: a website accepted a request to change a phone number without proof that the user meant to send it. The site tried to protect itself with a secret code, but that code could be reused in a pattern, so an attacker could still trick a logged-in user into changing their number.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.