Naked: kid traversal

One bug: the verifier reads its HMAC key from a file named by the token header’s kid, joined onto a keys directory with no sanitisation. The legit key file (ratauth.key) is on disk but you cannot read it. Point kid at a file whose contents you already know — e.g. an empty one — sign the token with that known key, and reach /naked/kid/admin as admin.

your session token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJhdGF1dGgua2V5In0.eyJzdWIiOiJkZW1vIiwidWlkIjoyLCJyb2xlIjoidXNlciJ9.uFskOlzAJbVHHJrJacivHuMEzvTQVtARkaq0cLmleAU
header
{
  "alg": "HS256",
  "typ": "JWT",
  "kid": "ratauth.key"
}
payload
{
  "sub": "demo",
  "uid": 2,
  "role": "user"
}

Present your forged token as the pp_kid cookie, or as ?token=<jwt>.

More hands-on practice → labs.hackxpert.com