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 package | Versions | Reported by |
|---|---|---|
| rust-openssl rust-openssl | >= 0.10.24, < 0.10.78 | CVE List |
| openssl (crates.io) | from 0.10.24 before 0.10.78 | GitHub Advisory Database, RustSec Advisory Database |
| rust-openssl_project rust-openssl | from 0.10.24 before 0.10.78 | NVD |
All scores
| GitHub_M | 7.2high CVSS:4.0 | 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 |
| GitHub | high CVSS:4.0 | 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 |
| NVD | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-41678 changed 2026-04-24 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-8c75-8mhr-p7r9 changed 2026-11-09 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2026-0463 changed 2026-11-09 | CC0-1.0 |
| NVD | CVE-2026-41678 changed 2026-11-11 | Public domain |