Bypass Jwt Authentication Access Admin Panel
The server accepted a JSON web token whose algorithm was changed to none and whose subject was changed to administrator, so the signature was not checked. An attacker could therefore reach the admin panel without being an administrator.
Servers typically do not store the information contained in JSON web token. They simply verify and decode the token and then authenticate the user according to the data.
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 accepted tokens using the none algorithm and did not verify the signature, so the token contents could be edited freely.
Impact
An attacker could reach the admin interface without being an administrator, because the server did not check the token signature.
What the attacker needed
A free account on the lab; Burp Suite with the JWT Editor extension
The fix
The server should reject tokens using the none algorithm and always verify the signature against a trusted key.
How it was found
- Create an account on the lab and log in, then capture the login request and its token in Burp.
- Send the request to the repeater and change the path to the admin page, which returns 401.
- In the JWT Editor tab, change the algorithm to none and the subject value to administrator.
- Remove the signature part of the token but keep the trailing dot.
- Send the request again and get a 200 response, then view the admin page in the browser.
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 note a site gives you after login, saying who you are. The site is meant to check the signature so nobody can edit the note. Here the site accepted a note with no signature at all, so the author could rewrite it to say they were the 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.