How I Discovered a Complete CSRF Protection Bypass on a Major Crypto Exchange And What Happened…
The Django admin panel accepted any 32-character string as a valid CSRF token, so an attacker could bypass CSRF protection on all POST endpoints. This could let an attacker force a logged-in admin to perform actions such as creating a superuser or resetting passwords.
infosecwriteups.com
Published on infosecwriteups.com
Every bug bounty hunter has that one story — the finding that felt like a breakthrough, only for reality to hit differently. This is mine.
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 application validated the CSRF token only by format and length, not cryptographically against the server's secret key.
Impact
Every POST endpoint was vulnerable, so an attacker could force a logged-in admin to create a backdoor superuser or reset passwords, though the company later said login CSRF was out of scope.
What the attacker needed
Victim is logged in as admin; victim visits attacker-controlled page; attacker can host a malicious page
The fix
The text does not state that the issue was fixed; it should be fixed by cryptographically validating CSRF tokens against the server's secret key.
How it was found
- Capture a normal login request in Burp Suite.
- Remove the CSRF token completely and observe a 403 Forbidden response.
- Send an invalid token and observe a 403 Forbidden response.
- Replace the CSRF token with a 32-character string of repeating '1's and observe a 200 OK response.
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.
CSRF is when a malicious website tricks your browser into sending a request to another site where you are logged in. Django normally uses a secret token to check that requests come from its own pages. Here the site only checked that the token was 32 characters long, so any made-up string worked.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.