CVE-2025-24898
Description
rust-openssl is a set of OpenSSL bindings for the Rust programming language. In affected versions ssl::select_next_proto can return a slice pointing into the server argument's buffer but with a lifetime bound to the client argument. In situations where the sever buffer's lifetime is shorter than the client buffer's, this can cause a use after free. This could cause the server to crash or to return arbitrary memory contents to the client. The crateopenssl version 0.10.70 fixes the signature of ssl::select_next_proto to properly constrain the output buffer's lifetime to that of both input buffers. Users are advised to upgrade. In standard usage of ssl::select_next_proto in the callback passed to SslContextBuilder::set_alpn_select_callback, code is only affected if the server buffer is constructed *within* the callback.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
opensslcrates.io | >= 0.10.0, < 0.10.70 | 0.10.70 |
Patches
2a4d399b0f1a3f014afb230deMerge pull request #2360 from sfackler/fix-alpn-lifetimes
1 file changed · +1 −1
openssl/src/ssl/mod.rs+1 −1 modified@@ -709,7 +709,7 @@ cfg_if! { /// /// [`SslContextBuilder::set_alpn_protos`]: struct.SslContextBuilder.html#method.set_alpn_protos #[corresponds(SSL_select_next_proto)] -pub fn select_next_proto<'a>(server: &[u8], client: &'a [u8]) -> Option<&'a [u8]> { +pub fn select_next_proto<'a>(server: &'a [u8], client: &'a [u8]) -> Option<&'a [u8]> { unsafe { let mut out = ptr::null_mut(); let mut outlen = 0;
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- github.com/advisories/GHSA-rpmj-rpgj-qmpmghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-24898ghsaADVISORY
- crates.io/crates/opensslnvdWEB
- github.com/sfackler/rust-openssl/commit/f014afb230de4d77bc79dea60e7e58c2f47b60f2ghsaWEB
- github.com/sfackler/rust-openssl/pull/2360nvdWEB
- github.com/sfackler/rust-openssl/security/advisories/GHSA-rpmj-rpgj-qmpmnvdWEB
- lists.debian.org/debian-lts-announce/2025/02/msg00009.htmlnvdWEB
- rustsec.org/advisories/RUSTSEC-2025-0004.htmlghsaWEB
News mentions
0No linked articles in our index yet.