CVE-2025-24898
mediumpriority · track · 0EPSS 0.007 · 52 %ileDEEURUUSEPSS · scored 2026-10-27
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 crate`openssl` 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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · low–medium · 1.7–6.3
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (13)
Products and version ranges known to be affected.
advisories (3)
Vendor and ecosystem advisories describing this.
- WID-SEC-W-2025-0366Vaultwarden: Schwachstelle ermöglicht Denial of Service oder Offenlegung von InformationenDeutsch2025-02-13csaf · cert_bundDE
Ein entfernter, anonymer Angreifer kann eine Schwachstelle in Vaultwarden ausnutzen, um einen Denial of Service Angriff durchzuführen oder Informationen offenzulegen.
- GHSA-rpmj-rpgj-qmpmrust-openssl ssl::select_next_proto use after free2025-02-03ghsa · osvUS
### Impact `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 `server` 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. ### Patches `openssl` 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. ### Workarounds 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. For example: Not vulnerable - the server buffer has a `'static` lifetime: ```rust builder.set_alpn_select_callback(|_, client_protos| { ssl::select_next_proto(b"\x02h2", client_protos).ok_or_else(AlpnError::NOACK) }); ``` Not vulnerable - the server buffer outlives the handshake: ```rust let server_protos = b"\x02h2".to_vec(); builder.set_alpn_select_callback(|_, client_protos| { ssl::select_next_proto(&server_protos, client_protos).ok_or_else(AlpnError::NOACK) }); ``` Vulnerable - the server buffer is freed when the callback returns: ```rust builder.set_alpn_select_callback(|_, client_protos| { let server_protos = b"\x02h2".to_vec(); ssl::select_next_proto(&server_protos, client_protos).ok_or_else(AlpnError::NOACK) }); ``` ### References https://github.com/sfackler/rust-openssl/pull/2360
- RUSTSEC-2025-0004ssl::select_next_proto use after free2025-02-02vendor · osvUS
In `openssl` versions before `0.10.70`, `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 `server` 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. `openssl` 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. 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. For example: Not vulnerable - the server buffer has a `'static` lifetime: ```rust builder.set_alpn_select_callback(|_, client_protos| { ssl::select_next_proto(b"\x02h2", client_protos).ok_or_else(AlpnError::NOACK) }); ``` Not vulnerable - the server buffer outlives the handshake: ```rust let server_protos = b"\x02h2".to_vec(); builder.set_alpn_select_callback(|_, client_protos| { ssl::select_next_proto(&server_protos, client_protos).ok_or_else(AlpnError::NOACK) }); ``` Vulnerable - the server buffer is freed when the callback returns: ```rust builder.set_alpn_select_callback(|_, client_protos| { let server_protos = b"\x02h2".to_vec(); ssl::select_next_proto(&server_protos, client_protos).ok_or_else(AlpnError::NOACK) }); ```
also known as (12)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (10)
External citations — patches, advisories, analysis.
- https://crates.io/crates/opensslcnnvd
- https://github.com/sfackler/rust-openssl/pull/2360cnnvd
- https://github.com/sfackler/rust-openssl/security/advisories/GHSA-rpmj-rpgj-qmpmcnnvd
- https://crates.io/crates/opensslenisa_euvd
- https://github.com/sfackler/rust-openssl/pull/2360enisa_euvd
- https://github.com/sfackler/rust-openssl/security/advisories/GHSA-rpmj-rpgj-qmpmenisa_euvd
- https://crates.io/crates/opensslnvd
- https://github.com/sfackler/rust-openssl/pull/2360nvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan