OverviewDeveloperHacker

JWT Gotchas: Break It, Fix It, Write It Up

Advanced0 enrolled · 0 submitted

Want in? Run /enroll in Discord to claim this tier before the build window closes.

The brief

Build a tiny deliberately vulnerable API that uses JSON Web Tokens, exploit its flaws in a controlled local lab, then patch it and document the whole journey.

You don't need to invent anything novel, just demonstrate understanding clearly.

Scope (local only):

  • Write a small API (any language) with a login endpoint and a protected /admin route.
  • Introduce 2 realistic flaws, such as accepting alg: none, a weak guessable HMAC secret, or trusting an unverified kid/claim.
  • Exploit each one with a short script or manual steps, then ship a fixed version and prove the exploit fails.

Ground rules: only attack your own local app. Don't test real services.

Primary deliverable: a clear writeup. The code and exploit scripts are the proof-of-work.

Deliverables

  • Repo containing the vulnerable app, the fixed app, and exploit scripts, clearly labeled as intentionally insecure
  • A writeup (Markdown) with, for each flaw: root cause, exploit steps, impact, and the fix
  • Proof-of-work: logs or screenshots showing exploit success on the vulnerable version and failure on the fixed one
  • A short list of 3–5 secure JWT habits you'd apply in future projects

Resources