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

> Attackers can trigger undefined behavior in rust-openssl by providing certificates with non-UTF-8 OCSP URLs, potentially leading to crashes or code execution.

- **Severity:** High 8.7 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 May 2026
- **Updated:** 15 May 2026
- **Also known as:** DEBIAN-CVE-2026-42327, GHSA-xp3w-r5p5-63rr, MINI-3g7w-6vr9-65pc, MINI-4w5m-cfp6-xgrx, MINI-8r87-6f22-3x29, MINI-fj2c-w9hh-m5wq, MINI-hvfp-4hx8-vc2x, MINI-pgv3-vqrm-rw4g, MINI-qq7q-xv92-fmjp, MINI-rpvm-2hrc-7cq7, MINI-vvrf-r46r-h85f, UBUNTU-CVE-2026-42327

## What is CVE-2026-42327?

CVE-2026-42327 is a high-severity memory corruption vulnerability in rust-openssl, published on 14 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2026-42327?

2 open source packages ship an affected version, including openssl.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openssl` | crates.io | From 0.9.7 | 0.10.79 |
| `openssl` | crates.io | From 0.9.7 | 0.10.79 |

## How do I fix CVE-2026-42327?

Upgrade openssl to 0.10.79 or later.

## Is CVE-2026-42327 being exploited?

There is no known exploitation of CVE-2026-42327 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-42327 and fix it if it is affected.

What it is: CVE-2026-42327 is a high-severity memory corruption vulnerability in rust-openssl, published on 14 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-42327 in the wild and no public exploit code.

Affected packages and fixed versions:
- openssl (crates.io): affected from 0.9.7; fixed in 0.10.79
- openssl (crates.io): affected from 0.9.7; fixed in 0.10.79

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-42327/ (Markdown: https://insights.sbomify.com/CVE-2026-42327/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-42327
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-42327
- OSV: https://osv.dev/vulnerability/CVE-2026-42327

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-42327/
Summaries are generated and may contain mistakes; the official description above is the record.
