---
title: "CWE-329: Generation of Predictable IV with CBC Mode"
url: https://radicalnotion.ai/cwe/cwe-329
type: cwe
description: "The product generates and uses a predictable initialization Vector (IV) with Cipher Block Chaining (CBC) Mode, which causes algorithms to be susceptible to dictionary attacks when they are encrypted under the same key."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-329: Generation of Predictable IV with CBC Mode

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **Likelihood of exploit:** Medium
- **CVEs with this as primary weakness:** 16
- **Of those, in CISA KEV:** 0
- **New in 2026:** 6
- **CWE catalog version:** 4.21

## Description

The product generates and uses a predictable initialization Vector (IV) with Cipher Block Chaining (CBC) Mode, which causes algorithms to be susceptible to dictionary attacks when they are encrypted under the same key.

CBC mode eliminates a weakness of Electronic Code Book (ECB) mode by allowing identical plaintext blocks to be encrypted to different ciphertext blocks. This is possible by the XOR-ing of an IV with the initial plaintext block so that every plaintext block in the chain is XOR'd with a different value before encryption. If IVs are reused, then identical plaintexts would be encrypted to identical ciphertexts. However, even if IVs are not identical but are predictable, then they still break the security of CBC mode against Chosen Plaintext Attacks (CPA).

## Background

CBC mode is a commonly used mode of operation for a block cipher. It works by XOR-ing an IV with the initial block of a plaintext prior to encryption and then XOR-ing each successive block of plaintext with the previous block of ciphertext before encryption. C\_0 = IV C\_i = E\_k{M\_i XOR C\_{i-1}} When used properly, CBC mode provides security against chosen plaintext attacks. Having an unpredictable IV is a crucial underpinning of this. See \[REF-1171\].

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | Developers might dismiss the importance of an unpredictable IV and choose an easier implementation to save effort, weakening the scheme in the process. |

## Applicable platforms

**Technologies:** ICS/OT (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality | Read Application Data | If the IV is not properly initialized, data that is encrypted can be compromised and leak information. |

## Potential mitigations

### Implementation

NIST recommends two methods of generating unpredictable IVs for CBC mode \[REF-1172\]. The first is to generate the IV randomly. The second method is to encrypt a nonce with the same key and cipher to be used to encrypt the plaintext. In this case the nonce must be unique but can be predictable, since the block cipher will act as a pseudo random permutation.

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Effectiveness: High

## Demonstrative examples

### Example 1

In the following examples, CBC mode is used when encrypting data:

Bad code:

```c
EVP_CIPHER_CTX ctx;
char key[EVP_MAX_KEY_LENGTH];
char iv[EVP_MAX_IV_LENGTH];
RAND_bytes(key, b);
memset(iv,0,EVP_MAX_IV_LENGTH);
EVP_EncryptInit(&ctx,EVP_bf_cbc(), key,iv);
```

Bad code:

```java
public class SymmetricCipherTest {
    public static void main() {

        byte[] text ="Secret".getBytes();
        byte[] iv ={
            0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
        };
        KeyGenerator kg = KeyGenerator.getInstance("DES");
        kg.init(56);
        SecretKey key = kg.generateKey();
        Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
        IvParameterSpec ips = new IvParameterSpec(iv);
        cipher.init(Cipher.ENCRYPT_MODE, key, ips);
        return cipher.doFinal(inpBytes);
    }
}
```

In both of these examples, the initialization vector (IV) is always a block of zeros. This makes the resulting cipher text much more predictable and susceptible to a dictionary attack.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2020-5408 | encryption functionality in an authentication framework uses a fixed null IV with CBC mode, allowing attackers to decrypt traffic in applications that use this functionality |
| CVE-2017-17704 | messages for a door-unlocking product use a fixed IV in CBC mode, which is the same after each restart |
| CVE-2017-11133 | application uses AES in CBC mode, but the pseudo-random secret and IV are generated using math.random, which is not cryptographically strong. |
| CVE-2007-3528 | Blowfish-CBC implementation constructs an IV where each byte is calculated modulo 8 instead of modulo 256, resulting in less than 12 bits for the effective IV length, and less than 4096 possible IV values. |
| CVE-2011-3389 | BEAST attack in SSL 3.0 / TLS 1.0. In CBC mode, chained initialization vectors are non-random, allowing decryption of HTTPS traffic using a chosen plaintext attack. |

## Real CVEs with this weakness (sample of 12 of 16)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2025-59322 | CPSD CryptoPro Secure Disk for Bitlocker before v7.7.4 fails to properly handle decryption errors... | high | 7.5 | - | No | 2026-08-12 |
| CVE-2023-0343 | CVE-2023-0343 | high | 7.5 | - | No | 2023-03-31 |
| CVE-2022-46397 | - | high | 7.5 | - | No | 2023-03-28 |
| CVE-2026-47842 | Deterministic AES/CBC Encryption in Spring Security AesBytesEncryptor Allows Ciphertext Correlation | medium | 6.5 | - | No | 2026-08-26 |
| CVE-2024-49783 | IBM OpenPages with Watson information disclosure | medium | 6.5 | - | No | 2025-07-08 |
| CVE-2020-5408 | Dictionary attack with Spring Security queryable text encryptor | medium | 6.5 | - | No | 2020-05-14 |
| CVE-2017-3226 | Das U-Boot's AES-CBC encryption feature improperly handles an error condition and may allow attacks against the underlying cryptographic implementation and allow an attacker to decrypt the data | medium | 6.4 | - | No | 2018-07-24 |
| CVE-2021-27499 | Use of Hard-coded Credentials in Ypsomed mylife | medium | 5.9 | - | No | 2021-08-02 |
| CVE-2026-86363 | - | medium | 5.5 | - | No | 2026-11-11 |
| CVE-2026-17137 | Multiple Vulnerabilities in IBM API Connect | medium | 5.5 | - | No | 2026-11-07 |
| CVE-2024-56141 | Minosoft has IV equal to key | medium | 5.0 | - | No | 2026-07-06 |
| CVE-2017-3225 | Das U-Boot's AES-CBC encryption feature uses a zero (0) initialization vector that may allow attacks against the underlying cryptographic implementation and allow an attacker to decrypt the data | medium | 4.6 | - | No | 2018-07-24 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-573](https://radicalnotion.ai/cwe/cwe-573) | Improper Following of Specification by Caller |
| Parent | [CWE-1204](https://radicalnotion.ai/cwe/cwe-1204) | Generation of Weak Initialization Vector (IV) |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CLASP | Not using a random IV with CBC mode | - | - |

## Frequently asked questions

### What is CWE-329?

The product generates and uses a predictable initialization Vector (IV) with Cipher Block Chaining (CBC) Mode, which causes algorithms to be susceptible to dictionary attacks when they are encrypted under the same key.

### What CVEs are caused by CWE-329?

16 recorded CVEs are attributed to CWE-329, including CVE-2025-59322, CVE-2023-0343 and CVE-2022-46397.

### How do you prevent CWE-329?

NIST recommends two methods of generating unpredictable IVs for CBC mode. The first is to generate the IV randomly. The second method is to encrypt a nonce with the same key and cipher to be used to encrypt the plaintext. In this case the nonce must be unique but can be predictable, since the block cipher will act as a pseudo random permutation.

### How is CWE-329 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-329?

Exploiting CWE-329 can lead to: Read Application Data.

### Is CWE-329 actively exploited?

16 recorded CVEs are caused by CWE-329; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/329.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-329). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
