A JWT is a container for claims. The server must verify who produced it and whether the claims are still allowed. Decoding is not verifying.
Some applications store base64url JSON without a signature. Others accept alg=none, use a guessable HMAC secret, or trust a role claim without checking it against the database. The attacker changes the claim and the server believes it.
- Decode the session cookie
- Change the role claim to admin
- Open the admin console and capture the flag
Token bytes to verified claims
Where to look before you type a payload
The server creates a header, payload and signature, then sends the token to the client.
The client keeps it in a cookie or storage. The server must protect it from theft and fixation.
The token returns in a header or cookie on each request.
The server checks the signature, algorithm, issuer, audience, expiry and key before trusting any claim.
Open one hint at a time. The first two build the model; the last two point at the boundary.
Hint 1
Decode the session cookie. Is it signed, or just base64url JSON?
Hint 2
Inspect the header algorithm and the role claim.
Hint 3
The verifier accepts alg=none. Build a token with an empty signature and an admin role.
Hint 4 · near the answer
Forge an admin token and open the admin console.
Observe → Hypothesize → Test → Prove → Explain
This is the same loop a reviewer expects in a report. Your draft stays in this browser; nothing is submitted until you choose to export it.
Evidence log
Write for a reviewer who was not in the room. Every claim needs a request, response or state change behind it.
Preview the evidence report
# Lab evidence report — Analytics Admin - Family: JWT - Lab ID: web-jwt-analytics-console - Date: 2026-12-05 ## Workflow ### Observe - [ ] Open "Analytics Admin" and record /admin, the HTTP method and the role you are given. - [ ] List every parameter, header, cookie and object identifier the normal flow exposes. - [ ] Save a baseline response: status, body shape, timing and the fields that change by user. ### Hypothesize - [ ] Name the server decision that protects /admin, and the evidence it should use. - [ ] Use the clue as a constraint, not an answer: The verifier accepts alg=none. Forge an unsigned admin token. - [ ] Predict the exact status, body or state change that would prove the decision is missing. ### Test - [ ] Start from the baseline and change one value: the token cookie. - [ ] Keep the request replayable; vary encoding, method or identifier location only after the first result. - [ ] Capture the full request and response for the winning attempt, including the flag. ### Prove - [ ] Capture the flag and name the exact foreign object, role or state change it proves. - [ ] Repeat from a clean session and confirm the result is not cached or stale. - [ ] State impact precisely: what data or action did you actually obtain? ### Explain - [ ] State the root cause without naming the payload: which decision failed? - [ ] Name the control that prevents recurrence and the layer where it belongs. - [ ] Write one regression test that fails before the fix and passes after it. ## Evidence ### Target and baseline _Not recorded._ ### Hypothesis _Not recorded._ ### Winning request _Not recorded._ ### Proof _Not recorded._ ### Root cause _Not recorded._ ### Control and regression test _Not recorded._ ## Analyst conclusion The proof demonstrates the missing control above. The regression test should fail against the vulnerable behavior and pass after remediation.
The full request, the reasoning and the debrief unlock after a successful capture. That is deliberate: struggle first, then consolidate.
False positives to rule out
- The payload is readable: JWT payloads are encoded, not encrypted. Confidentiality requires encryption or avoiding sensitive claims.
- Changing a claim breaks the signature: that is expected; look for endpoints that decode without verifying.
- The token uses HS256: HMAC is not inherently weak, but the secret must be long, random and rotated.
Regression tests to name
- Algorithm pinning: Verification fails and no claims are trusted
- Claim tampering: The request is rejected
- Key endpoint: The server uses only its configured key set
- Allowlist the accepted algorithm and verify the signature before reading claims.
- Use a strong secret or asymmetric keys, rotate them and keep expiry short.
- Authorize every sensitive action against server-side state, not only token claims.
التوكن ليس ثقة بحد ذاته؛ الثقة في التحقق من توقيعه ومن صلاحياته.