Advanced·450 points·8 solves
Vaultline — Weak JWT Secret
Learn to attack a JWT with a weak signing secret: when an HS256 token is signed with a guessable password, an offline crack recovers the secret and lets you forge any token — including admin.
This verifier is otherwise correct: it accepts ONLY HS256 and checks the signature properly, so the alg:none trick does not work here. The single flaw is the SECRET. HS256 signs the token with HMAC-SHA256 over a secret key, and the whole `header.payload.signature` is public in your guest token — so you can try candidate secrets OFFLINE: for each word, recompute the signature and see if it matches. A short, common secret (a dictionary word) falls in seconds to tools like hashcat (mode 16500) or jwt_tool with a wordlist. Once you know the secret you can mint a token with any claims you want. The fix is a long, random, high-entropy secret (or asymmetric RS256 where the server holds a private key you can never reach).
Your tasks
1
Get your guest token
Open the lab. The home page issues a signed guest token (also set as a cookie). Copy it.
2
Confirm the algorithm
base64url-decode the header — it is HS256. HS256 is symmetric: the same secret signs and verifies, and the token is public, so the secret is crackable offline.
3
Crack the secret
Feed the token to an offline cracker with a wordlist — hashcat -m 16500, or jwt_tool -C -d <wordlist>. A common word secret cracks quickly.
4
Forge an admin token
Re-sign a token with payload {"admin":true} using the cracked secret (HS256). jwt_tool -S hs256 -p <secret>, or a few lines of code.
5
Enter the admin console
Send your forged token to /admin (Authorization: Bearer <token>, or the session cookie). The flag is there.
Submit the flag
Start the lab, capture the flag from the running machine, and submit it here.