PortSwigger

Lab Description
This lab uses a JWT-based mechanism for handling sessions. Due to implementation flaws, the > server doesn’t verify the signature of any JWTs that it receives.
Objective: Modify your session token to gain access to the admin panel at
/admin, then > delete the usercarlos.Credentials:
wiener:peter
Step 1: Log In and Capture the JWT
- Log in as
wiener:peter - In Burp Proxy, find the
GET /my-accountrequest - Observe the
sessioncookie - it’s a JWT
Decoded JWT from the request:
Header: {"kid": "...", "alg": "RS256"}
Payload: {"iss": "portswigger", "exp": 1766082227, "sub": "wiener"}
Signature: <some signature>

Step 2: Send to Repeater
- Right-click the
GET /my-accountrequest - Select **Send to Repeater
Step 3: Test Admin Access
- In Repeater, change the path to
/admin - Send the request
- Access denied (only administrators can access)
Step 4: Modify the JWT Payload

- In the JSON Web Token tab, select the Payload
- Change the
subclaim:- From:
wiener - To:
administrator
- From:
- Click Apply changes
Modified Payload:
{"iss": "portswigger", "exp": 1766082227, "sub": "administrator"}
Step 5: Send the Forged Request
- Do NOT modify the signature - keep it as is
- Send the request in Repeater
- Access granted to
/admin

Step 6: Delete Carlos
- In the response, find the delete link:
/admin/delete?username=carlos
- Change the path to:
/admin/delete?username=carlos - Send the request

Step 7: Lab Solved
