rust-openssl: Incorrect bounds assertion in aes key wrap
cve-program · CVE-2026-41678
Publishedrust-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.
Read the publisher's advisoryeuvd · EUVD-2026-25584
Publishedrust-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.
Read the publisher's advisorynvd · CVE-2026-41678
Publishedrust-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.
Read the publisher's advisoryosv · GHSA-8c75-8mhr-p7r9
Published### 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.
Read the publisher's advisoryosv · RUSTSEC-2026-0463
Published`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.
Read the publisher's advisoryAffected versions, risk and source history
Related advisories and sources
Publishers link these advisories through the identifiers shown below. A shared identifier or date alone does not tell you whether your software is affected or whether the advisories describe the same cause.
CVE-2026-41678 · CVE overview and exploitation status
cve-program · CVE-2026-41678
euvd · EUVD-2026-25584
nvd · CVE-2026-41678
osv · GHSA-8c75-8mhr-p7r9
- https://github.com/rust-openssl/rust-openssl/security/advisories/GHSA-8c75-8mhr-p7r9
- https://nvd.nist.gov/vuln/detail/CVE-2026-41678
- https://github.com/rust-openssl/rust-openssl/pull/2604
- https://github.com/rust-openssl/rust-openssl/commit/718d07ff8ff7be417d5b7a6a0047f1607520b3b6
- https://github.com/rust-openssl/rust-openssl
- https://github.com/rust-openssl/rust-openssl/releases/tag/openssl-v0.10.78
osv · RUSTSEC-2026-0463
Related changes
Linked by CVE identifier- 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 i… · Advisory content revised · 15 Nov 2026
- Out-of-bounds write in `aes::unwrap_key` · Newly collected advisory · 9 Nov 2026
- rust-openssl has incorrect bounds assertion in aes key wrap · Advisory content revised · 9 Nov 2026