Skip to content
Account takeover Write-up Intermediate

Broken JWTs, Open Doors: How I Turned ‘None’ Algorithm into

A web application accepted JSON Web Tokens that used the 'none' signing algorithm and also used a weak, guessable secret key, so the author could change their own role from user to admin. With admin access they reached an endpoint that ran system commands and obtained a root shell on the server.

iski Follow

Published on medium.com

Free link 🎈

Iski, 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 server trusted the algorithm named inside the token (accepting 'none') and signed tokens with a weak dictionary-word secret, so role claims were never reliably protected.

Impact

The author could take full admin control, read all user data including password hashes and live API keys, and run commands as root on the server.

What the attacker needed

A free account; access to browser developer tools

The fix

The application should reject the none algorithm, verify signatures with a long random secret, and remove command execution from the admin panel.

How it was found

  1. Create a free account and open the browser developer tools to find the token in local storage.
  2. Decode the token and note the role field set to user.
  3. Craft a token with the none algorithm and the role changed to admin.
  4. Replace the stored token and refresh the page to reach the admin dashboard.
  5. Brute-force the signing secret with a wordlist to confirm it is weak.
  6. Use the admin command endpoint to run a reverse shell and gain root.

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 small signed note a website gives you after login, and the site reads it to decide who you are. If the site does not check the signature properly, or uses a guessable signing key, you can edit the note to claim you are an administrator. Here the author did exactly that and then found an admin feature that ran commands on the server.

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 iski

View all

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