CSRF to ATO: How I Took Over Accounts on Target.com with One POST Request
The profile email-change endpoint accepted POST requests without any anti-CSRF token or verification step. An attacker could host an auto-submitting form, have a logged-in victim visit it, change the victim's email to an attacker-controlled address, then use password reset to take over the account.
By Shah kaif | “They said CSRF is low impact. I said hold my payload.” | LinkedIn
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
The email-change endpoint relied only on the session cookie and had no CSRF token or re-authentication check, so cross-site POST requests were accepted as legitimate.
Impact
An attacker could take over a victim's account by changing their email and resetting the password, provided the victim visited the malicious page while logged in.
What the attacker needed
Victim logged into the site; victim visits attacker page
The fix
The email-change endpoint should be fixed by requiring a per-session CSRF token and re-authentication before changing the email address.
How it was found
- Visit the profile edit page while logged in and intercept the email-change POST request.
- Confirm the request has no CSRF token header or hidden field.
- Change your own email and observe the numeric response codes for success and duplicate email.
- Host an auto-submitting HTML form that posts the same request with an attacker email.
- Get a logged-in victim to visit the page so their email is changed.
- Trigger password reset, receive the OTP at the attacker address, and reset the password.
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.
When you are logged into a site, your browser automatically sends your session cookie with every request to that site. If a sensitive action like changing your email has no extra secret token tied to the form, another website can quietly submit that request for you. The attacker then controls the email on the account and can reset the password.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.