Use this when CBC mode is used and you need to check IVs, MACs and padding-oracle risk.
CBC
CBC (Cipher Block Chaining) XORs each plaintext block with the previous ciphertext block. It needs a random IV and separate integrity protection and has been hit by padding-oracle attacks, so GCM is preferred.
1. CBC needs a random IV and separate MAC (encrypt-then-MAC).
2. Padding oracles (POODLE, Lucky13) have broken implementations.
3. Prefer GCM/ChaCha20.
4. Remove CBC TLS suites where clients allow.
5. Uniform error handling.
IV + plaintext blocks chained → ciphertext (+ MAC)
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Padding oracle Narrow the fault
CBC uses padding (PKCS#7). If a server reveals whether padding was valid — through different errors or timing — an attacker can decrypt ciphertext byte by byte without the key. POODLE (SSL 3.0) and Lucky13 (TLS) were variants. Verifying a MAC over the ciphertext before decrypting (encrypt-then-MAC) prevents it.
Step 2 Common mistakes Narrow the fault
- CBC without integrity (padding oracle risk).
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- CBC needs a random, unpredictable IV.
- It needs a separate MAC (encrypt-then-MAC).
- Padding oracle attacks have broken many CBC uses.
nmap --script ssl-enum-ciphers -p 443 <host> | grep CBC— CBC suites- Encrypt-then-MAC/HMAC present — integrity
- Padding oracle error handling — uniform errors
ReferenceWhy it matters1 section · depth on demand
Risks
- Without a MAC, attackers can flip bits in the next block.
- Padding oracle attacks (POODLE, Lucky13) recover plaintext when errors leak whether padding was valid.
- A predictable IV allowed BEAST in TLS 1.0.
Use CBC only with encrypt-then-MAC, or replace it with GCM.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
CBC (Cipher Block Chaining) mode XORs each plaintext block with the previous ciphertext block before encryption, using a random IV for the first block. It hides patterns that ECB reveals, but it provides no integrity on its own and requires padding, which led to practical attacks (padding oracles such as POODLE and Lucky Thirteen).
Safe use requires a random, unpredictable IV per message and a separate MAC applied after encryption (encrypt-then-MAC). In practice, prefer AEAD modes (GCM, ChaCha20-Poly1305); TLS 1.3 removed CBC suites entirely. Remove CBC suites from TLS 1.2 configurations where clients allow it.
Correct use
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Symmetric Cryptography → CBC. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://csrc.nist.gov/pubs/fips/197/final · confidence 94%