Token Trouble: How Leaked JWTs Let Me Become Everyone on the Internet
The application leaked JWT tokens in error responses and JavaScript files, and accepted multiple JWT algorithms including 'none'. An attacker could use a leaked admin token to access admin endpoints and export all user data.
Free link 🎈
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 application logged sensitive tokens in error responses and failed to properly validate JWT signatures and algorithms.
Impact
An attacker could gain full admin access and export all user data.
What the attacker needed
Access to the application; ability to trigger errors
The fix
The application should not log tokens, should reject the 'none' algorithm, and should use strong secrets; the text does not state whether these were fixed.
How it was found
- Scan JavaScript files and network traffic for JWT patterns.
- Analyse found tokens by decoding them without verification.
- Test algorithm confusion attacks such as 'none' and weak secrets.
- Trigger an error to receive a leaked admin token in the response.
- Use the admin token to access admin endpoints and export user data.
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 JWT is a token that proves who you are when you use a website. This site accidentally showed these tokens in error messages and code files, and it also accepted tokens that were not properly signed. So anyone who found a token could pretend to be that user, even an admin.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.