CVE-2026-42327

rust-openssl: undefined behavior in X509Ref::ocsp_responders for certificates with non-UTF-8 OCSP URLs

Published May 14, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
rust-openssl provides OpenSSL bindings for the Rust programming language. From 0.9.7 to before 0.10.79, X509Ref::ocsp_responders returns OCSP responder URLs from a certificate's AIA extension as OpensslString, whose Deref<Target = str> wraps the raw bytes with str::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 &str that violates the UTF-8 invariant — resulting in undefined behavior. This vulnerability is fixed in 0.10.79.

Analysis

AI-generated

Technical impact

rust-openssl, a Rust binding for OpenSSL, returned OCSP responder URLs as &str by wrapping raw bytes with str::from_utf8_unchecked when parsing the certificate's AIA extension. Because OpenSSL does not enforce that the IA5String is ASCII, a certificate containing non‑UTF‑8 bytes in its OCSP accessLocation can trigger construction of a &str that violates the UTF‑8 invariant, resulting in undefined behavior. If exploited, this could corrupt memory, cause a crash, or potentially allow an attacker to execute arbitrary code within the process that uses the vulnerable library.

Affected Systems

The vulnerability affects the rust‑openssl crate versions 0.9.7 up to and including 0.10.78. Systems that compile or link against any of these versions—particularly applications that handle X509 certificates with OCSP URLs—are impacted. The fix is included in version 0.10.79 and later.

Risk and Exploitability

The CVSS score is 8.7, indicating a high severity that would be classed as "Critical" in many contexts. The EPSS score of 0.00048 indicates a very low probability of exploitation, and the lack of a KEV listing does not preclude exploitation, especially in environments that use untrusted certificates. Based on the description, the likely attack vector is a local or remote delivery of a crafted certificate with non‑UTF‑8 OCSP URLs to a vulnerable application that processes X509 certificates via rust‑openssl. The undefined behavior induced by the unchecked conversion could be leveraged to cause a crash or, in a sophisticated scenario, to manipulate program control flow and achieve code execution. The vulnerability is already fixed in a later library version, so the primary vector is unpatched usage.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the rust-openssl crate to version 0.10.79 or later, ensuring that Cargo.lock reflects the updated dependency
  • Recompile affected applications against the fixed library and perform regression testing to verify stability
  • For environments that cannot immediately upgrade, validate or sanitize OCSP URLs prior to passing certificates to rust-openssl, or replace the library with a vetted alternative

Generated by OpenCVE AI on May 20, 2026 at 01:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-xp3w-r5p5-63rr rust-openssl has undefined behavior in X509Ref::ocsp_responders for certificates with non-UTF-8 OCSP URLs
History
Type Values Removed Values Added
Weaknesses CWE-475
References
Metrics threat_severity

None

cvssV3_1

{'score': 9.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N'}

threat_severity

Important

Type Values Removed Values Added
First Time appeared Rust-openssl Project
Rust-openssl Project rust-openssl
Vendors & Products Rust-openssl Project
Rust-openssl Project rust-openssl
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description rust-openssl provides OpenSSL bindings for the Rust programming language. From 0.9.7 to before 0.10.79, X509Ref::ocsp_responders returns OCSP responder URLs from a certificate's AIA extension as OpensslString, whose Deref<Target = str> wraps the raw bytes with str::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 &str that violates the UTF-8 invariant — resulting in undefined behavior. This vulnerability is fixed in 0.10.79.
Title rust-openssl: undefined behavior in X509Ref::ocsp_responders for certificates with non-UTF-8 OCSP URLs
Weaknesses CWE-20
References
Metrics cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-20

    Improper Input Validation

  • CWE-475

    Undefined Behavior for Input to API

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 15, 2026, 6:05 PM
Reserved
Apr 26, 2026, 12:37 PM
Status
Deferred
Published
May 14, 2026, 9:16 PM
Modified
Jun 17, 2026, 10:47 AM
Severity
Important
Public date
May 14, 2026, 8:17 PM