Verify a JWT Without a Library
An internal tool must check the tokens issued by the auth service before acting on them. Tokens are JWTs signed with HMAC-SHA256 (HS256) and a shared secret.
Create the executable script /home/student/bin/jwt-verify.sh TOKEN (secret in the environment variable JWT_SECRET). It must:
"alg": "HS256" (reject none, HS512 and anything else),header.payload (compare in constant time),exp claim in the future, and if there's an nbf claim, require it to be now or in the past,0,1; exit 2 when JWT_SECRET is unset or empty.Python 3 is installed (no JWT library).
About this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.