CVE-2026-41678
JSON

7.2high

rust-openssl: Incorrect bounds assertion in aes key wrap

Severity
7.2high CVSS:4.0 by GitHub_M
Exploit likelihood
0.26% (higher than 19% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-8c75-8mhr-p7r9RUSTSEC-2026-0463

Description

rust-openssl provides OpenSSL bindings for the Rust programming language. From to before 0.10.78, aes::unwrap_key() contains an incorrect assertion: it checks that out.len() + 8 <= in_.len(), but this condition is reversed. The intended invariant is out.len() >= in_.len() - 8, ensuring the output buffer is large enough. Because of the inverted check, the function only accepts buffers at or below the minimum required size and rejects larger ones. If a smaller buffer is provided the function will write past the end of out by in_.len() - 8 - out.len() bytes, causing an out-of-bounds write from a safe public function. This vulnerability is fixed in 0.10.78.

Affected

Product or packageVersionsReported by
rust-openssl rust-openssl>= 0.10.24, < 0.10.78CVE List
openssl (crates.io)from 0.10.24 before 0.10.78GitHub Advisory Database, RustSec Advisory Database
rust-openssl_project rust-opensslfrom 0.10.24 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
NVD8.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-787

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

What each source says

CVE List

rust-openssl provides OpenSSL bindings for the Rust programming language. From to before 0.10.78, aes::unwrap_key() contains an incorrect assertion: it checks that out.len() + 8 <= in_.len(), but this condition is reversed. The intended invariant is out.len() >= in_.len() - 8, ensuring the output buffer is large enough. Because of the inverted check, the function only accepts buffers at or below the minimum required size and rejects larger ones. If a smaller buffer is provided the function will write past the end of out by in_.len() - 8 - out.len() bytes, causing an out-of-bounds write from a safe public function. This vulnerability is fixed in 0.10.78.

GitHub Advisory Database
Summary

aes::unwrap_key() has an incorrect bounds assertion on the out buffer size, which can lead to out-of-bounds write.

Details

aes::unwrap_key() contains an incorrect assertion: it checks that out.len() + 8 <= in_.len(), but this condition is reversed. The intended invariant is out.len() >= in_.len() - 8, ensuring the output buffer is large enough.

Because of the inverted check, the function only accepts buffers at or below the minimum required size and rejects larger ones. If a smaller buffer is provided the function will write past the end of out by in_.len() - 8 - out.len() bytes, causing an out-of-bounds write from a safe public function.

Impact

Vulnerable applications using AES keywrap and allowing attacker controlled buffer sizes could have an attacker trigger an out-of-bounds write.

RustSec Advisory Database

openssl::aes::unwrap_key guarded the size of its output buffer with an inverted assertion, out.len() + 8 <= in_.len(). Instead of rejecting an out buffer too small for the unwrapped key, it rejected buffers larger than needed and accepted buffers that were too small.

When out is shorter than in_.len() - 8 bytes, the underlying AES_unwrap_key call writes past the end of out. This out-of-bounds write is reachable from a safe function; applications that let untrusted input influence the input or output buffer sizes are exposed.

The function was added in 0.10.24. 0.10.78 corrects the assertion, so an output buffer that is too small now causes a panic before anything is written.

NVD (es)

rust-openssl proporciona enlaces OpenSSL para el lenguaje de programación Rust. Desde hasta antes de la versión 0.10.78, aes::unwrap_key() contiene una aserción incorrecta: verifica que out.len() + 8 <= in_.len(), pero esta condición está invertida. El invariante previsto es out.len() >= in_.len() - 8, asegurando que el búfer de salida sea lo suficientemente grande. Debido a la verificación invertida, la función solo acepta búferes iguales o inferiores al tamaño mínimo requerido y rechaza los más grandes. Si se proporciona un búfer más pequeño, la función escribirá más allá del final de out en in_.len() - 8 - out.len() bytes, causando una escritura fuera de límites desde una función pública segura. Esta vulnerabilidad se corrige en la versión 0.10.78.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-41678 changed 2026-04-24CVE Terms of Use
GitHub Advisory DatabaseGHSA-8c75-8mhr-p7r9 changed 2026-11-09CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2026-0463 changed 2026-11-09CC0-1.0
NVDCVE-2026-41678 changed 2026-11-11Public domain