Skip to content
Access control Write-up Beginner

My Bug Bounty Journey #9: Account Takeover via JWT Misconfiguration

The site validated JWTs for authentication but did not enforce role-based authorization, so every logged-in user was treated as having the same role. An attacker could list all user accounts, reset other users' passwords including the admin's, and perform admin actions.

awchjimmy Follow

Published on medium.com

Hi, I’m Jimmy, and this is part of My Bug Bounty Journey series. Today, we’re going to dive into a chained exploit: an account takeover caused by a JWT misconfiguration.

awchjimmy, 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

Likely the API endpoints relied only on a valid JWT for authentication and never checked the user's role or permissions for authorization.

Impact

An attacker could take over any account, including the administrator's, and carry out all admin actions.

What the attacker needed

A valid user account; access to the site's JavaScript file

The fix

The API should enforce role-based authorization on every endpoint, not just validate the JWT.

How it was found

  1. Log in to the site and obtain a valid JWT.
  2. Inspect the JavaScript file to find the exposed API endpoints.
  3. Call the endpoints to list user accounts and reset other users' passwords, including the admin's.
  4. Perform admin actions using the same token.

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 to prove who you are. This site checked the token was valid but never checked what role you had, so any normal user could call admin-only functions. The attacker found those hidden functions listed in a JavaScript file and used them to take over accounts.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by awchjimmy

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.