pentesting, updated
Testing for padding oracle
Check whether the app leaks, via error or timing, whether decrypted ciphertext padding was valid — enough to decrypt data without the key.
Goal
Confirm decryption failures (bad padding vs. bad content) can’t be distinguished by an attacker, closing the oracle.
How to test
Find a parameter that looks like encrypted/encoded data (a __VIEWSTATE-style token, an encrypted cookie) and compare the app’s response to a ciphertext with valid vs. invalid padding:
curl -s https://example.com/ -b "token=<ciphertext-with-flipped-byte>"
If a distinguishable error exists, tools like padbuster automate full plaintext recovery (and, on some stacks, re-encryption of attacker-chosen plaintext).
What to look for
A different error, status code, or timing between a padding failure and a content/validation failure.
References
- OWASP WSTG-CRYP-02 — Testing for Padding Oracle.