CVE-2026-41681
JSON

8.1high

rust-openssl: MdCtxRef::digest_final() writes past caller buffer with no length check

Severity
8.1high CVSS:4.0 by GitHub_M
Exploit likelihood
0.37% (higher than 33% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-ghm9-cr32-g9qjRUSTSEC-2026-0475

Description

rust-openssl provides OpenSSL bindings for the Rust programming language. From 0.10.39 to before 0.10.78, EVP_DigestFinal() always writes EVP_MD_CTX_size(ctx) to the out buffer. If out is smaller than that, MdCtxRef::digest_final() writes past its end, usually corrupting the stack. This is reachable from safe Rust. This vulnerability is fixed in 0.10.78.

Affected

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

All scores

GitHub_M8.1high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/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:N/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-121

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.10.39 to before 0.10.78, EVP_DigestFinal() always writes EVP_MD_CTX_size(ctx) to the out buffer. If out is smaller than that, MdCtxRef::digest_final() writes past its end, usually corrupting the stack. This is reachable from safe Rust. This vulnerability is fixed in 0.10.78.

GitHub Advisory Database

EVP_DigestFinal() always writes EVP_MD_CTX_size(ctx) to the out buffer. If out is smaller than that, MdCtxRef::digest_final() writes past its end, usually corrupting the stack. This is reachable from safe Rust.

RustSec Advisory Database

MdCtxRef::digest_final passed the caller's output slice to OpenSSL's EVP_DigestFinal without checking its length. EVP_DigestFinal always writes the full digest (EVP_MD_CTX_size bytes), so an output slice shorter than the digest is overrun. With a stack buffer this usually corrupts the stack. The overflow is reachable from safe code.

MdCtxRef was added in 0.10.39. 0.10.78 checks the slice length first and returns an error when the slice is too short for the digest.

NVD (es)

rust-openssl proporciona enlaces de OpenSSL para el lenguaje de programación Rust. Desde la 0.10.39 hasta antes de la 0.10.78, EVP_DigestFinal() siempre escribe EVP_MD_CTX_size(ctx) en el búfer de salida. Si out es más pequeño que eso, MdCtxRef::digest_final() escribe más allá de su final, corrompiendo habitualmente la pila. Esto es alcanzable desde Rust seguro. Esta vulnerabilidad está corregida en la 0.10.78.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-41681 changed 2026-04-24CVE Terms of Use
GitHub Advisory DatabaseGHSA-ghm9-cr32-g9qj changed 2026-11-10CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2026-0475 changed 2026-11-10CC0-1.0
NVDCVE-2026-41681 changed 2026-11-11Public domain