I Was Hunting for an IDOR, but Ended Up Finding a CSRF Vulnerabil
A profile update endpoint validated its CSRF token only when the request was sent as POST. By sending the same operation as GET, the token check was skipped and the profile update succeeded, so an attacker could make a logged-in user change their profile via a crafted page.
Published on medium.com
Sometimes the vulnerability you’re looking for simply isn’t there — but the one you eventually find is even more interesting.
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 CSRF token check was applied only to POST handlers, leaving the same state-changing action reachable through GET without validation.
Impact
An attacker could potentially trick an authenticated user into performing unintended actions simply by making them visit a crafted page.
What the attacker needed
Victim is logged in; victim visits an attacker page
The fix
The CSRF token should be validated on every state-changing request regardless of HTTP method, and such actions should not be reachable via GET.
How it was found
- Capture the profile update request in a proxy.
- Note that authentication is cookie-based and no custom headers are sent.
- Try invalid, empty, removed and other-account tokens; all are rejected.
- Change only the HTTP method from POST to GET and resend.
- Observe the profile update succeeds without token validation.
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 token is a secret value a site puts in a form so it can tell a real action by the user from one triggered by another website. Here the site only checked that token for POST requests, so switching the request to GET let the action through without it. An attacker could then build a page that quietly makes a logged-in victim's browser send the GET request and change their profile.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.