CVE-2025-24898 — openssl
Fix: sfackler/rust-openssl#2360CVE-2025-24898 is a Use After Free vulnerability in openssl. A fix is available for openssl — see the affected versions and patch details below.
rust openssl ssl::select_next_proto use after free
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2025-24898.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
opensslReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
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:
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:
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:
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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | openssl | ≥ 0.10.0&&< 0.10.70 | 0.10.70cargo update -p openssl --precise 0.10.70 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for openssl, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update openssl to 0.10.70 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-24898 is resolved across your whole dependency graph.
Workarounds
Constrain what reaches the vulnerable code: limit the size and shape of untrusted input, isolate the affected component in a sandboxed or least-privileged process, and enable the platform's memory-safety mitigations (ASLR, stack protector, hardened allocator) so an out-of-bounds access is more likely to fail closed than to be exploitable.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This Moderate-impact flaw affects Red Hat products that use the vulnerable rust-openssl functionality. In affected versions, ssl::select_next_proto can return a slice into the server buffer while its lifetime is tied only to the client buffer; if the server buffer is created within the callback and has a shorter…
Users should upgrade to an available vendor-provided update. Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.Source: Red Hat security advisory for CVE-2025-24898 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Enterprise Linux 9 | rpm-ostree-0:2025.5-1.el9 | RHSA-2025:7147 |
| Red Hat Enterprise Linux 9 | bootc-0:1.1.6-3.el9_6 | RHSA-2025:7160 |
| Red Hat Enterprise Linux 9 | rust-bootupd-0:0.2.27-3.el9 | RHSA-2025:7241 |
| Red Hat Enterprise Linux 9 | keylime-agent-rust-0:0.2.2-2.el9 | RHSA-2025:7313 |
| Red Hat Enterprise Linux 9 | python3.12-cryptography-0:41.0.7-2.el9 | RHSA-2025:7317 |
Frequently Asked Questions
Is CVE-2025-24898 in your dependencies?
Find it across crates.io, including transitive dependencies.