目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1000

100.0%

CWE-329 在CBC加密模式中未使用随机化IV向量 类漏洞列表 6

CWE-329 在CBC加密模式中未使用随机化IV向量 类弱点 6 条 CVE 漏洞汇总,含 AI 中文分析。

CWE-329 属于加密实现缺陷,指在使用 CBC 模式时生成可预测的初始化向量(IV)。由于 IV 缺乏随机性,攻击者可利用此弱点实施字典攻击或选择明文攻击,从而推断出加密密钥或还原明文数据。开发者应确保每次加密操作均使用密码学安全的随机数生成器产生唯一且不可预测的 IV,以保障数据的机密性与完整性。

MITRE CWE 官方描述
CWE:CWE-329 使用 CBC 模式生成可预测的初始化向量 (IV) 该产品生成并使用可预测的初始化向量 (IV) 配合密码块链接 (CBC) 模式,这导致在相同密钥下加密时,算法容易受到字典攻击。 CBC 模式通过允许相同的明文块被加密为不同的密文块,消除了电子密码本 (ECB) 模式的弱点。这是通过将初始化向量 (IV) 与初始明文块进行异或 (XOR) 运算实现的,从而确保链中的每个明文块在加密前都与不同的值进行异或。如果重用初始化向量 (IV),则相同的明文将被加密为相同的密文。然而,即使初始化向量 (IV) 不完全相同但可预测,它们仍然会破坏 CBC 模式针对选择明文攻击 (CPA) 的安全性。
常见影响 (1)
ConfidentialityRead Application Data
If the IV is not properly initialized, data that is encrypted can be compromised and leak information.
缓解措施 (1)
ImplementationNIST 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.
代码示例 (1)
In the following examples, CBC mode is used when encrypting data:
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 · C
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); } }
Bad · Java
CVE ID标题CVSS风险等级Published
CVE-2024-49783 IBM OpenPages with Watson 安全漏洞 — OpenPages with Watson 5.3 Medium2025-07-08
CVE-2022-29054 Fortinet FortiOS 安全漏洞 — FortiOS 3.1 Low2023-02-16
CVE-2021-27499 Ypsomed mylife App 安全特征问题漏洞 — Ypsomed mylife Cloud, mylife Mobile Application 5.9 -2021-08-02
CVE-2020-5408 Vmware VMware Spring Security 安全特征问题漏洞 — Spring Security 4.3 -2020-05-14
CVE-2017-3225 DENX Software Engineering Das U-Boot 加密问题漏洞 — U-Boot 3.9 -2018-07-24
CVE-2017-3226 DENX Software Engineering Das U-Boot 加密问题漏洞 — U-Boot 6.4 -2018-07-24

CWE-329(在CBC加密模式中未使用随机化IV向量) 是常见的弱点类别,本平台收录该类弱点关联的 6 条 CVE 漏洞。