Skip to content
Account takeover Write-up Intermediate

How an Unsigned JWT Parameter Led to a $10,500 Full Account Takeo

The session-switch endpoint accepted an unsigned account_id parameter from the request body and minted a new signed JWT for that account, ignoring the identity in the original token. An attacker could supply another user's sequential account ID and receive a valid token for that account, leading to full account takeover.

T4nv1 Follow

Published on medium.com

JSON Web Tokens (JWTs) are the unsung heroes of modern stateless authentication. They allow applications to verify user identity securely without querying a central database for every single HTTP request.

T4nv1, on 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

Root cause

The session-management microservice trusted an unsigned account_id body parameter instead of deriving identity from the verified JWT claims, creating a duplicate source of truth.

Impact

An attacker could obtain valid tokens for other users, gaining full read/write access to their travel logs, itineraries and saved business credit cards, and could automate enumeration because account IDs were sequential.

What the attacker needed

A valid low-privilege account; ability to intercept and modify requests; knowledge of a target account ID

The fix

The account_id body parameter was removed and the service was changed to take identity only from the verified JWT claims.

How it was found

  1. Log in and intercept the dashboard request to capture the JWT.
  2. Find the profile division-switch request that sends target_division and account_id in the JSON body.
  3. Change the account_id in the body to another account's ID and send the request.
  4. Receive a new signed JWT whose payload contains the other account's user_id.
  5. Place the new token in browser local storage and refresh to access the other account.

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 a signed piece of data a site gives you after login so it can recognise you later; the signature stops you editing it. Here the site checked the signature on your old token, but then built a new token using an account number you typed in the request body, without checking it matched you. So you could ask for a token belonging to someone else and get one that was properly signed.

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.

More by T4nv1

View all

113 more disclosed reports, best first.

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.