Easy Csrf Bypass
The profile update endpoint accepted requests with the anti-CSRF token parameter removed or sent blank, so the token check could be skipped. An attacker could make a logged-in victim submit a forged form that changed the victim's profile details, including their email address.
Published on infosecwriteups.com
Today I want to talk about one of my findings in a private program at Hacker-One platform, which refers to it as target.com.
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 treated a missing or empty anti-CSRF token as acceptable instead of rejecting the request.
Impact
An attacker could change a logged-in victim's profile details, including their email address, which could lead to account takeover; the report was triaged as medium severity.
What the attacker needed
Victim is logged in; victim opens attacker's link
The fix
The server should require a unique, secret, unpredictable anti-CSRF token on every state-changing request and reject requests where it is missing or blank.
How it was found
- Log in with valid credentials in the Firefox browser.
- Change something on the profile page.
- Intercept the request using Burp Suite Professional.
- Send the request to Repeater.
- Use the engagement tools in Burp to generate a CSRF proof of concept.
- Save the generated HTML as a file, send its link to the victim, and the profile details change when the victim opens it.
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 CSRF attack tricks a logged-in user's browser into sending a request the user did not intend, such as changing their profile. Sites normally stop this with a secret token that must accompany each change. Here the server did not properly check that token, so a page hosted by an attacker could submit the change on the victim's behalf.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.