CVE-2026-41676
JSON

7.2high

rust-openssl: Deriver::derive and PkeyCtxRef::derive can overflow short buffers on OpenSSL 1.1.1

Severity
7.2high CVSS:4.0 by GitHub_M
Exploit likelihood
0.48% (higher than 33% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-pqf5-4pqq-29f5RUSTSEC-2026-0473

Description

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 EVP_PKEY_derive, 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.

Affected

Product or packageVersionsReported by
rust-openssl rust-openssl>= 0.9.27, < 0.10.78CVE List
openssl (crates.io)from 0.9.27 before 0.10.78GitHub Advisory Database, RustSec Advisory Database
rust-openssl_project rust-opensslfrom 0.9.27 before 0.10.78NVD

All scores

GitHub_M7.2high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-131CWE-787

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

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 EVP_PKEY_derive, 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.

GitHub Advisory Database

Deriver::derive (and PkeyCtxRef::derive) sets len = buf.len() and passes it as the in/out length to EVP_PKEY_derive, 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.

RustSec Advisory Database

Deriver::derive and PkeyCtxRef::derive pass the length of the caller's buffer to EVP_PKEY_derive and rely on OpenSSL to write no more than that. With OpenSSL 1.1.x, the X25519, X448 and HKDF-extract implementations ignore the length they are given and always write the whole result, so a buffer shorter than the shared secret or derived key is overrun. The overflow is reachable from safe code.

OpenSSL 3.x checks the length itself and is not affected. From 0.10.78, when built against OpenSSL 1.1.x or LibreSSL, both functions derive into a temporary buffer of the required size whenever the caller's buffer is too short, and copy only what fits.

NVD (es)

rust-openssl proporciona enlaces de OpenSSL para el lenguaje de programación Rust. Desde 0.9.27 hasta antes de 0.10.78, Deriver::derive (y PkeyCtxRef::derive) establece len = buf.len() y lo pasa como la longitud de entrada/salida a EVP_PKEY_derive, confiando en que OpenSSL lo respete. En OpenSSL 1.1.x, X25519, X448, DH y HKDF-extract ignoran el keylen entrante, escribiendo incondicionalmente el secreto compartido completo (32/56/tamaño-primo bytes). Un llamador que pasa un segmento corto obtiene un desbordamiento de montón/pila desde código seguro. Los proveedores de OpenSSL 3.x sí verifican, por lo que esto solo afecta a versiones anteriores de OpenSSL. Esta vulnerabilidad está corregida en 0.10.78.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-41676 changed 2026-04-24CVE Terms of Use
GitHub Advisory DatabaseGHSA-pqf5-4pqq-29f5 changed 2026-11-10CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2026-0473 changed 2026-11-10CC0-1.0
NVDCVE-2026-41676 changed 2026-11-11Public domain