{"id":"CVE-2026-41676","aliases":["CVE-2026-41676","GHSA-pqf5-4pqq-29f5","RUSTSEC-2026-0473"],"related":[],"kind":"vulnerability","state":"published","title":"rust-openssl: Deriver::derive and PkeyCtxRef::derive can overflow short buffers on OpenSSL 1.1.1","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"`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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"`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.\n\nOpenSSL 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.","format":"markdown","source":"rustsec"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-04-19T12:00:00.000Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS: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","score":7.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS: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","score":7.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS: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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-131","CWE-787"],"affected":[{"ranges":[{"version":">= 0.9.27, < 0.10.78","status":"affected"}],"vendor":"rust-openssl","product":"rust-openssl","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.9.27","status":"affected","fixed":"0.10.78"}],"ecosystem":"crates.io","package":"openssl","purl":"pkg:cargo/openssl","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.9.27","status":"affected","fixed":"0.10.78"}],"ecosystem":"crates.io","package":"openssl","purl":"pkg:cargo/openssl","source":"rustsec"},{"ranges":[{"status":"affected","introduced":"0.9.27","fixed":"0.10.78"}],"vendor":"rust-openssl_project","product":"rust-openssl","cpe":"cpe:2.3:a:rust-openssl_project:rust-openssl:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/rust-openssl/rust-openssl/security/advisories/GHSA-pqf5-4pqq-29f5","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41676","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rust-openssl/rust-openssl/pull/2606","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/rust-openssl/rust-openssl/commit/09b425e5f59a2466d806e71a83a9a449c914c596","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rust-openssl/rust-openssl","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rust-openssl/rust-openssl/releases/tag/openssl-v0.10.78","tags":["web"],"sources":["ghsa"]},{"url":"https://crates.io/crates/openssl","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0473.html","tags":["advisory"],"sources":["rustsec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-04-24T17:43:14.622Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41676","url":"https://www.cve.org/CVERecord?id=CVE-2026-41676","licence":"CVE Terms of Use","modified":"2026-04-24T17:43:20.693Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pqf5-4pqq-29f5","url":"https://github.com/advisories/GHSA-pqf5-4pqq-29f5","licence":"CC-BY-4.0","modified":"2026-11-10T14:10:59.704Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0473","url":"https://rustsec.org/advisories/RUSTSEC-2026-0473.html","licence":"CC0-1.0","modified":"2026-11-10T14:00:02.488Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41676","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41676","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.551Z","epss":{"score":0.00476,"percentile":0.33421,"date":"2026-11-30T12:00:22.000Z"}}