Skip to main content
Module 4 · Lesson 3 of 414/42 in the course~15 min
Module lessons (3/4)

Breaking Weak JWTs (alg: none & Claims)

Lesson preview6 hands-on exercises readyApplication & Web Security · Module 4 — Authentication, Sessions, JWT & Access Control

Tamper JWT headers and role claims interactively, forge an unsigned alg:none token, and enforce strict header algorithm pinning.

What you'll learn in this lesson

  • Decode and inspect the three Base64URL segments of a JSON Web Token (Header, Payload, Signature).
  • Exploit a vulnerable JWT verifier that blindly honors 'alg': 'none' or trusts unverified header fields.
  • Enforce server-side algorithm pinning plus fail-closed iss, aud, nbf, exp, and jti claim validation.

Overview

A JWT looks opaque, yet its Header and Payload are plain Base64URL-encoded JSON readable by anyone. Security collapses completely if a verifier decides how to validate a token based on what the untrusted attacker wrote inside header.alg.

Walk through why decoding and trusting header fields before verification fails:

Sections covered in this lesson

  1. 11. Anatomy of a JWS & Header Confusion Attacks
  2. 22. Interactive Explorer: JWT Header & Claims Tampering
  3. 33. Progressive Labs: Warm-Up → Attack → Defend → Harden
  4. 44. Checkpoints & Code Review
Pro Lesson · Module 4 — Authentication, Sessions, JWT & Access Control

Unlock "Breaking Weak JWTs (alg: none & Claims)" and the full Application & Web Security curriculum

Tamper JWT headers and role claims interactively, forge an unsigned alg:none token, and enforce strict header algorithm pinning.

Unlock all 6 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in Application & Web Security plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.