CSRF token valid even after the session logout of a particular user
The anti-CSRF token remained valid after a user logged out and logged back in, so an attacker who obtained a token could reuse it to submit forms on the user's behalf. The report claims the token should be invalidated on logout.
Originally disclosed on HackerOne
- Disclosed after 4 months
Hi,
To reproduce the issue:
-
Login to your https://secure.phabricator.com account and copy your Anti CSRF token.
-
Now logout and again login after sometime.
-
Open up your burp suite to modify the request and now submit any form with your old CSRF token.
The request will be completed.
So let's suppose i am somehow able to get CSRF token of a particular user then i can use the same token again and again to perform the attack.
The token should be thrown from the db after the session logout.
Please have a look.
Best regards, Anand
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application does not invalidate or rotate the anti-CSRF token when the user's session is destroyed on logout.
Impact
An attacker who somehow obtained a user's CSRF token could reuse it repeatedly to perform actions as that user, even after the user logs out.
What the attacker needed
Attacker obtains the victim's CSRF token
How it was found
- Log in and copy the anti-CSRF token.
- Log out and log in again after some time.
- Use an intercepting proxy to submit a form with the old token.
- Observe that the request is accepted.
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 report has not been written yet. The Original tab links to the source.
A CSRF token is a secret value a website puts in forms to prove a request came from its own pages, not from another site. Here the token kept working even after the user logged out and back in, so anyone who stole a token could keep using it. The reporter says the token should be deleted when the session ends.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.