Skip to content

Commit 9ba00ea

Browse files
rushilmehrainikulin
authored andcommitted
Fix lifetimes in ssl::select_next_proto
See sfackler/rust-openssl#2360 and https://nvd.nist.gov/vuln/detail/CVE-2025-24898. From the rust-openssl PR: `SSL_select_next_proto` can return a pointer into either the client or server buffers, but the type signature of the function previously only bound the output buffer to the client buffer. This can result in a UAF in situations where the server slice does not point to a long-lived allocation. Thanks to Matt Mastracci for reporting this issue.
1 parent 7ba3225 commit 9ba00ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

boring/src/ssl/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ impl CompliancePolicy {
806806
///
807807
/// [`SslContextBuilder::set_alpn_protos`]: struct.SslContextBuilder.html#method.set_alpn_protos
808808
#[corresponds(SSL_select_next_proto)]
809-
pub fn select_next_proto<'a>(server: &[u8], client: &'a [u8]) -> Option<&'a [u8]> {
809+
pub fn select_next_proto<'a>(server: &'a [u8], client: &'a [u8]) -> Option<&'a [u8]> {
810810
if server.is_empty() || client.is_empty() {
811811
return None;
812812
}

0 commit comments

Comments
 (0)