How a simple CSRF attack turned into a P1
A password change form included a mandatory email field that was not validated on the server, so an attacker could craft a CSRF request with any correctly formatted email address and change a victim's password. Clicking the link would lock the victim out and let the attacker log in with the new password.
Published on ladysecspeare.wordpress.com
Cross-site Request Forgery is easy to lookout for. However, if there are security measures in place to prevent CSRF attacks, they can be exciting (yet nerve-wracking) to bypass.
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
Impact
An attacker could take over a victim's account by changing their password via CSRF, locking the victim out, though the text does not mention any defence that limited the attack.
What the attacker needed
Victim is logged in; victim clicks a crafted link; attacker can host a CSRF page
The fix
The server should validate the email field against the logged-in user's actual email address, and the text says the remediation is to ensure necessary validation is in place.
How it was found
- Find the change password endpoint and note the mandatory email field in the request.
- Try a CSRF proof of concept with the attacker's own email address, which fails.
- Try removing the field, removing only its value, and entering random text, all of which fail.
- Enter a random but correctly formatted email address in the field.
- Submit the CSRF request from another browser acting as the victim and see the success message.
- Log in as the victim using the new password to confirm the account takeover.
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.
Cross-site request forgery (CSRF) is when a malicious site makes a logged-in user's browser send a request to another site without the user meaning to. Here the password change form had an email field that the server did not check properly, so the attacker could put any made-up email address in it and still change the victim's password. The victim only had to click a link while logged in.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.