8.7high
rust-openssl: undefined behavior in X509Ref::ocsp_responders for certificates with non-UTF-8 OCSP URLs
- Severity
- 8.7high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.21% (higher than 11% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-xp3w-r5p5-63rrRUSTSEC-2026-0474
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rust-openssl rust-openssl | >= 0.9.7, < 0.10.79 | CVE List |
| openssl (crates.io) | from 0.9.7 before 0.10.79 | GitHub Advisory Database, RustSec Advisory Database |
All scores
| GitHub_M | 8.7high CVSS:4.0 | 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 |
| GitHub | high CVSS:4.0 | 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 |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
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.
RustSec Advisory Database
X509Ref::ocsp_responders returns the OCSP responder URLs from a certificate's Authority Information Access extension as OpensslString values, which dereference to str without validating the bytes. OpenSSL does not require these IA5String values to be ASCII, so for a certificate with non-UTF-8 bytes in an OCSP access location, safe code ends up holding a &str that is not valid UTF-8, which is undefined behavior. Certificates often come from untrusted peers.
ocsp_responders was added in 0.9.7. 0.10.79 checks each URL and returns an error if it is not valid UTF-8.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-42327 changed 2026-05-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-xp3w-r5p5-63rr changed 2026-11-10 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2026-0474 changed 2026-11-10 | CC0-1.0 |
| NVD | CVE-2026-42327 changed 2026-06-17 | Public domain |