Skip to content
Account takeover Write-up Intermediate

🎯 Weak JWT Secret Leads to 0-Click Account Takeover — First Critical Accept

The JWT signing secret was the weak value 'secret', allowing an attacker to forge tokens. By combining the victim's public user ID with the attacker's own session identifier, the attacker could change the victim's username and email, leading to full account takeover via password reset.

Muhammad Saad Sabir Follow

Published on msaadsbr.medium.com

This is the story of how I stumbled upon my first Account Takeover (ATO) using a weakly signed JWT on an asset listed in Intigriti’s VDP program. Let’s call the website target.com.

Muhammad Saad Sabir, on msaadsbr.medium.com

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 fully take over any user's account by changing their email and resetting the password, with no user interaction required.

What the attacker needed

A free account; knowledge of victim's public user ID; no user interaction

The fix

The report was resolved, but the text does not specify the fix; it should involve using a strong, random JWT secret and properly binding session identifiers to user IDs.

How it was found

  1. Sign up and log in to obtain a JWT.
  2. Crack the JWT secret using a wordlist (found 'secret').
  3. Forge a JWT with the victim's public user ID and the attacker's session identifier.
  4. Send a GraphQL request to change the victim's username, receiving 200 OK.
  5. Send a GraphQL request to change the victim's email to the attacker's email.
  6. Reset the victim's password using the new email to complete account takeover.

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 JWT is a token a website gives you after login to prove who you are; it is signed with a secret key so it cannot be forged. Here the secret key was a very common word, so the attacker could create valid tokens for any user. By mixing the victim's public ID with their own session ID, they could act as the victim and change the victim's email, then reset the password.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.