CVE-2026-41676: rust-openssl: Deriver::derive and PkeyCtxRef::derive can overflow short buffers on OpenSSL 1.1.1
Deriver::derive (and PkeyCtxRef::derive) sets len = buf.len() and passes it as the in/out length to EVPPKEYderive, relying on OpenSSL to honor it. On OpenSSL 1.1.x, X25519, X448, DH and HKDF-extract ignore the incoming keylen, unconditionally writing the full shared secret (32/56/prime-size bytes). A caller passing a short slice gets a heap/stack overflow from safe code. OpenSSL 3.x providers do check, so this only impacts older OpenSSL.
Other sources
rust-openssl provides OpenSSL bindings for the Rust programming language. From 0.9.27 to before 0.10.78, Deriver::derive (and PkeyCtxRef::derive) sets len = buf.len() and passes it as the in/out length to EVPPKEYderive, relying on OpenSSL to honor it. On OpenSSL 1.1.x, X25519, X448, DH and HKDF-extract ignore the incoming keylen, unconditionally writing the full shared secret (32/56/prime-size bytes). A caller passing a short slice gets a heap/stack overflow from safe code. OpenSSL 3.x providers do check, so this only impacts older OpenSSL. This vulnerability is fixed in 0.10.78.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rust/opensslto a version that resolves this vulnerability.Fixed in 0.10.78 - Upgrade
Upgrade
rust-opensslto a version that resolves this vulnerability.Fixed in 0.10.78 - Compensating control
If you cannot upgrade to rust-openssl 0.10.78, run systems using OpenSSL 1.1.x (including X25519, X448, DH, and HKDF-extract) with additional input-length validation in the calling code so `Deriver::derive` / `PkeyCtxRef::derive` are never invoked with short buffers.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-41676?
CVE-2026-41676 presents a high severity vulnerability due to its potential to lead to information disclosure.
How do I fix CVE-2026-41676?
To fix CVE-2026-41676, update the Rust OpenSSL package to version 0.10.78 or later.
Which software versions are affected by CVE-2026-41676?
CVE-2026-41676 affects Rust OpenSSL versions between 0.9.27 and 0.10.78, excluding the latter.
What components are involved in CVE-2026-41676?
CVE-2026-41676 involves the Deriver::derive and PkeyCtxRef::derive components in conjunction with OpenSSL functionality.
What are the implications of CVE-2026-41676?
The implications of CVE-2026-41676 include the potential leakage of sensitive cryptographic keys, which can compromise security.