sfackler/rust-openssl · Security
openssl's `MemBio::get_buf` has undefined behavior with empty buffers
- GHSA ID
- GHSA-q445-7m23-qrmw
- Severity
- medium
- Published
- Updated
- CVSS
- 6.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
- CVSS v3
- 6.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
- CVSS v4
- 6.9 · CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N
Description
Previously, MemBio::get_buf called slice::from_raw_parts with a null-pointer, which violates the functions invariants, leading to undefined behavior. In debug builds this would produce an assertion failure. This is now fixed.
CWEs
- CWE-476 · NULL Pointer Dereference
References
- https://github.com/sfackler/rust-openssl/pull/2266 ↗
- https://github.com/sfackler/rust-openssl/commit/aef36e0f3950653148d6644309ee41ccf16e02bb ↗
- https://github.com/sfackler/rust-openssl/releases/tag/openssl-v0.10.66 ↗
- https://rustsec.org/advisories/RUSTSEC-2024-0357.html ↗
- https://github.com/advisories/GHSA-q445-7m23-qrmw ↗