rust-openssl has undefined behavior in X509Ref::ocsp_responders for certificates with non-UTF-8 OCSP URLs
High severity
GitHub Reviewed
Published
May 4, 2026
in
rust-openssl/rust-openssl
•
Updated May 15, 2026
Description
Published to the GitHub Advisory Database
May 5, 2026
Reviewed
May 5, 2026
Published by the National Vulnerability Database
May 14, 2026
Last updated
May 15, 2026
X509Ref::ocsp_respondersreturns OCSP responder URLs from a certificate's AIA extension asOpensslString, whoseDeref<Target = str>wraps the raw bytes withstr::from_utf8_unchecked. OpenSSL does not enforce that the underlying IA5String is ASCII, so a certificate with non-UTF-8 bytes in its OCSP accessLocation causes safe Rust code to construct a&strthat violates the UTF-8 invariant — resulting in undefined behavior.References