| name | wstg-cryp-02 |
| description | Testing for Padding Oracle |
| category | cryptography |
| owasp_id | WSTG-CRYP-02 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["cryptography","tls","ssl","encryption","wstg","cryp"] |
| tech_stack | ["tls","ssl"] |
| cwe_ids | ["CWE-326"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
wstg-cryp-02
Test ID
WSTG-CRYP-02
Test Name
Testing for Padding Oracle
High-Level Description
A padding oracle attack exploits the information leaked when a system reveals whether decrypted data has valid padding. This occurs with block ciphers in CBC mode when the application returns different error messages or behaviors for valid versus invalid padding. Attackers can use this to decrypt ciphertext without knowing the key.
What to Check
How to Test
Step 1: Identify Encrypted Data
curl -sI "https://target.com" | grep -i "set-cookie"
curl -s "https://target.com/WebResource.axd?d=ENCRYPTED_DATA"
curl -s "https://target.com/ScriptResource.axd?d=ENCRYPTED_DATA"
Step 2: Test Response Differences
#!/bin/bash
TARGET="https://target.com"
PARAM="encrypted_value"
original="VALID_ENCRYPTED_BASE64"
modified=$(echo "$original" | base64 -d | -c -1 | - <( ) | )
curl -s | -5
-e
curl -s | -5