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.
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.
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
- Find JWTs in cookies, headers and local storage.
- Decode the token to read its claims.
- Change the role claim from user to admin.
- 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.