Lion Cipher Lab

Exploit a CBC padding oracle to decrypt without the key

Why it matters

In the predecessor lab you flipped one byte of a CBC ciphertext and changed the message with no error — proof that unauthenticated CBC has no integrity. This lab shows the far scarier consequence: if the receiving system so much as HINTS whether the padding was valid, an attacker who never has the key can decrypt the entire message. That hint can be an exception, a different error page, a status code, even a timing difference. This exact flaw — Vaudenay's 2002 padding oracle — is not a museum piece: POODLE (2014) broke SSL 3.0 with a padding-oracle-style attack, and Lucky Thirteen (2013)…

What you'll learn

Steps in this lab

  1. What you're about to do (and why it should feel impossible)
  2. The one equation the whole attack rests on
  3. Understand PKCS#7 padding — the thing the oracle checks
  4. Build the vulnerable oracle (server.py)
  5. The intuition: recover ONE byte (onebyte.py)
  6. Automate it: recover the whole message (attack.py)
  7. When this bites in the real world (and why it kept happening)
  8. The fix: authenticate, and never distinguish the failure

Open the full interactive lab →