CSRF token fixation and potential account takeover
The CSRF token (fkey parameter) was fixed per browser and did not change after login or logout, so many users could share the same token. An attacker who knew a victim's token could force a change of the victim's email address, potentially taking over the account.
- Triaged in 43 hours
- Fixed in 3 months
- Disclosed after 3 months
Hi Team,
Details:
I have found that the csrf_token ( fkey parameter )which prevent CSRF attacks is fixed in same browser and didn't changed even user login or logout , a lot of users can use the same CSRF_token , this can be exploited such 2 ways :
Shared computers:
- attacker open "https://www.khanacademy.org" and login to his account
- attacker copied the value of "fkey parameter" then he will logout
- victim will logged in his account with the same CSRF_token value (fkey parameter)
- now attacker forced the victim to change his email address to attacker emails , since he already have the valid CSRF_token
XSS:
- due to XSS vulnerability. Attacker knows the CSRF_token for the victim so he can use this in any actions behind the victim , for example : change user email address
CSRF PoC to takeover user account by linked the attacker email address:
<html>
<body>
<form action="https://www.khanacademy.org/settings/linkemail" method="POST">
<input type="hidden" name="fkey" value="CSRF_token" />
<input type="hidden" name="email" value="[attacker-email-address]" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
Impact
As i described above this can be exploited to takeover another account
Let me know if there is anything unclear
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 generated the CSRF token once per browser session and never rotated it on authentication state changes, so the token was not tied to the logged-in user.
Impact
An attacker could potentially take over another user's account by linking the attacker's email address, though the report does not show a full end-to-end exploit.
What the attacker needed
Attacker and victim share a browser; victim logs in after attacker; attacker knows the token
How it was found
- Attacker logs in to the site and copies the fkey parameter value.
- Attacker logs out, leaving the same token in the browser.
- Victim logs in on the same browser, which still has the same token.
- Attacker uses the known token to force the victim to change their email address.
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 really came from its own pages, not from an attacker's site. Here the token stayed the same for a browser even after logging in or out, so an attacker could learn it and reuse it. With that token, the attacker could make a victim's browser send a request that changes the victim's email address to one the attacker controls.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.