What happened
Issue summary: Parsing CMS AuthEnvelopedData or EnvelopedData message with maliciously crafted AEAD parameters can trigger a stack buffer overflow. Impact summary: A stack buffer overflow may lead to a crash, causing Denial of Service, or potentially remote code execution. When parsing CMS (Auth)EnvelopedData structures that use AEAD ciphers such as AES-GCM, the IV (Initialization Vector) encoded in the ASN.1 parameters is copied into a fixed-size stack buffer without verifying that its length fits the destination. An attacker can supply a crafted CMS message with an oversized IV, causing a stack-based out-of-bounds write before any authentication or tag verification occurs. Applications and services that parse untrusted CMS or PKCS#7 content using AEAD ciphers (e.g., S/MIME (Auth)EnvelopedData with AES-GCM) are vulnerable. Because the overflow occurs prior to authentication, no valid key material is required to trigger it. While exploitability to remote code execution depends on platform and toolchain mitigations, the stack-based write primitive represents a severe risk. The FIPS modules in 3.6, 3.5, 3.4, 3.3 and 3.0 are not affected by this issue, as the CMS implementation is outside the OpenSSL FIPS module boundary. OpenSSL 3.6, 3.5, 3.4, 3.3 and 3.0 are vulnerable to this issue. OpenSSL 1.1.1 and 1.0.2 are not affected by this issue.
Affected versions
OpenSSL: 3.6.0 through before 3.6.1 (semver); 3.5.0 through before 3.5.5 (semver); 3.4.0 through before 3.4.4 (semver); 3.3.0 through before 3.3.6 (semver); 3.0.0 through before 3.0.19 (semver); before * (custom); before V1.8.0 (custom); before V3.3.2 (custom); before V9.0 QU1 (custom); V4.0.700 through before * (custom); before V9.3 SP2 (custom); before V5.7 SP4 (custom); before V3.19 P024 (custom); before V3.20 P012 (custom); before V3.21 P02 (custom); before V17 Update 9 (custom); before V21 (custom); before V3.1.13 (custom); before V3.2.4 (custom); V6.3 through before * (custom); before V1.0 SP2 Update 5 (custom); before V4.2 SP3 (custom); before V2.15.3.0 (custom) Fixed: See vendor advisory.
Why it matters
Review the vendor advisory and exposure of the affected product to determine operational impact.
Detection & mitigation
- Apply vendor-provided updates or mitigations.
- Review affected product exposure and access logs.