Skip to content
Access control Write-up Intermediate

Exploiting Misconfigured JWT: How I Owned 30+ Accounts via Token

The article describes several common JWT misconfigurations, including accepting unsigned tokens, weak signing secrets, unverified role claims, missing expiry checks and algorithm confusion. The author claims that on one target the role field was not checked against the database, so editing the token unlocked the admin panel and gave access to over 30 accounts.

Narendar Battula Follow

Published on javascript.plainenglish.io

JWTs are compact, URL-safe tokens used for securely transmitting information between parties. They’re commonly used for authentication in modern web applications.

Narendar Battula (nArEn), on javascript.plainenglish.io

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 server trusted role and identity claims inside the token without verifying them against the database or enforcing the signature algorithm.

Impact

An attacker could escalate their privileges to administrator and take over more than 30 accounts.

What the attacker needed

A valid low-privilege account token

The fix

The server should strictly allow only the expected algorithm, verify the signature, and check roles and privileges in backend logic rather than trusting token claims.

How it was found

  1. Find JWTs in cookies, headers and local storage.
  2. Decode the token to read its claims.
  3. Change the role claim from user to admin.
  4. Re-sign or otherwise submit the modified token and reach the admin panel.

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 is a small signed string a website gives you after login to prove who you are. If the site does not check the signature or trusts what the token says about your role, you can edit it and pretend to be someone else, such as an administrator.

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 Narendar Battula

View all

7 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.