How I Made $6,000 by Exploiting JWT Manipulation on a Web3 Crypto
A Web3 crypto platform signed its authentication tokens with a weak, guessable secret key. An attacker who recovered that key could forge a token claiming admin rights and gain administrative access to the platform.
Published on cybersecuritywriteups.com
A few months ago, while hunting for vulnerabilities in Web3 applications, I stumbled upon a critical JWT (JSON Web Token) manipulation bug that led to a $6,000 bounty payout! 🚀 If you’re into bug bounty hunting, cybersecurity, or Web3 security, you’ll love this breakdown of how I found, exploited, and reported this…
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 used a weak, guessable HMAC secret for signing JWTs, allowing the signing key to be recovered and tokens to be forged.
Impact
An attacker could forge an admin token and gain administrative access to the platform.
What the attacker needed
A valid user account on the platform; ability to intercept HTTP requests; a wordlist for brute-forcing the key
The fix
The application should use a strong, securely stored signing key (for example asymmetric RS256 keys), validate signatures server-side, and not rely on token claims alone for privilege checks.
How it was found
- Intercept a request and copy the JWT used for authentication.
- Decode the token to inspect its header and payload.
- Brute-force the HS256 secret key using a wordlist.
- Modify the payload to set the admin claim to true.
- Re-sign the modified token with the recovered secret.
- Replace the original token in the request and refresh to obtain admin access.
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 piece of text a website gives you after login to prove who you are. The signature is made with a secret key, so if that key is easy to guess, someone can write their own token saying they are an administrator and the site will believe it. Here the key was weak enough to crack, so the author could pretend to be an admin.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.