Abusing JSON Web Token to steal accounts — 3000$
The application used a JSON Web Token (JWT) for authentication, but the token's payload contained a user ID that was not properly validated. An attacker could change their own ID to a victim's ID and access the victim's account, and the victim's ID could be obtained by submitting their email address during the login or registration flow.
Published on filipaze.medium.com
My name is Filipe Azevedo, I am a Cyber Security Researcher from Portugal. I work mainly for Intigriti and Hackerone.
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
Impact
An attacker could access any user's account by changing the ID in their JWT, and could obtain a victim's ID by submitting their email address during the login or registration process.
What the attacker needed
A valid account; victim's email address
How it was found
- Log in and capture your JWT.
- Observe that the only difference between two JWTs is the user ID in the payload.
- Change your ID to the victim's ID in the JWT.
- Use the modified JWT to access the victim's account.
- Obtain the victim's ID by submitting their email during the login or registration flow, which leaks the ID in a request.
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 JSON Web Token (JWT) is like a digital ID card that a website gives you after you log in. It contains information about you, such as your user ID, and is signed so it cannot be changed. Here, the website trusted the ID inside the token without checking if it really belonged to the person using it, so anyone could edit their token to pretend to be someone else.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.