CVE-2026-31789
OpenSSL vulnerability analysis and mitigation

Overview

CVE-2026-31789 is a heap buffer overflow vulnerability in OpenSSL affecting the buf2hex conversion function in crypto/o_str.c. When converting an excessively large OCTET STRING value (e.g., from X.509 certificate extensions such as Subject Key Identifier or Authority Key Identifier) to a hexadecimal string, the required buffer size is calculated by multiplying the input length by 3. On 32-bit platforms, this multiplication can overflow, resulting in allocation of an undersized buffer and a subsequent heap buffer overflow. Affected versions include OpenSSL 3.0.0–3.0.19, 3.3.0–3.3.6, 3.4.0–3.4.4, 3.5.0–3.5.5, and 3.6.0–3.6.1. The vulnerability was disclosed on April 7, 2026, and assigned Low severity by OpenSSL due to practical exploitation constraints, though Feedly's CVSS estimate rates it 9.8 (Critical) (OpenSSL Advisory, GitHub Advisory).

Technical details

The root cause is an integer overflow (CWE-787: Out-of-bounds Write) in the buf2hexstr_sep and ossl_buf2hexstr_sep functions within crypto/o_str.c. When computing the output buffer size as buflen * 3 (with separator) or 1 + buflen * 2 (without separator), the multiplication is performed without overflow checking on 32-bit platforms where size_t is 32 bits. If an attacker supplies a crafted X.509 certificate with an OCTET STRING value exceeding approximately 1 GB in extensions like SKID or AKID, the size calculation wraps around, causing OPENSSL_malloc to allocate a buffer smaller than required, followed by a heap buffer overflow when the hex conversion writes beyond the allocated region. The fix adds explicit overflow guards before the multiplication in both functions (OpenSSL Commit a242160, OpenSSL Commit 364f095). The vulnerability is only exploitable on 32-bit platforms and requires the application to print or log the contents of untrusted X.509 certificates. OpenSSL FIPS modules in versions 3.0, 3.3, 3.4, 3.5, and 3.6 are not affected, as the vulnerable code lies outside the FIPS module boundary (OpenSSL Advisory).

Impact

Successful exploitation on a vulnerable 32-bit platform can result in a heap buffer overflow, potentially leading to application crash (denial of service), attacker-controlled code execution, or other undefined behavior. Applications and services that parse, print, or log untrusted X.509 certificates — such as TLS servers, certificate validation tools, or logging pipelines — are at risk. The practical impact is constrained by the requirement for a >1 GB certificate and a 32-bit runtime environment, making real-world exploitation scenarios relatively narrow (OpenSSL Advisory, GitHub Advisory).

Exploitation steps

  1. Identify target: Locate a 32-bit application or service that uses a vulnerable OpenSSL version (3.0.0–3.0.19, 3.3.0–3.3.6, 3.4.0–3.4.4, 3.5.0–3.5.5, or 3.6.0–3.6.1) and prints or logs the contents of untrusted X.509 certificates (e.g., a TLS server with verbose certificate logging, or a certificate inspection tool).
  2. Craft malicious certificate: Generate an X.509 certificate containing an excessively large OCTET STRING value (exceeding ~715 MB for separator mode, or ~2 GB for non-separator mode) in an extension such as the Subject Key Identifier (SKID) or Authority Key Identifier (AKID).
  3. Deliver certificate: Present the crafted certificate to the target application during a TLS handshake or by supplying it as input to a certificate parsing/logging utility.
  4. Trigger overflow: When the application attempts to convert the oversized OCTET STRING to a hex string via buf2hexstr_sep or ossl_buf2hexstr_sep, the buffer size calculation overflows on the 32-bit platform, causing allocation of an undersized heap buffer.
  5. Achieve impact: The subsequent write beyond the allocated buffer results in heap corruption, potentially causing a crash or, under controlled heap layout conditions, attacker-influenced code execution (OpenSSL Advisory, OpenSSL Commit a242160).

Indicators of compromise

  • Logs: Application crash logs or core dumps from OpenSSL-linked processes on 32-bit systems, particularly referencing buf2hexstr_sep or ossl_buf2hexstr_sep in stack traces; error messages containing CRYPTO_R_TOO_MANY_BYTES (present only in patched versions — absence may indicate unpatched state).
  • Network: Inbound TLS connections presenting certificates with abnormally large extension fields (SKID or AKID values exceeding hundreds of megabytes); unusually large TLS Certificate handshake messages.
  • File System: Unexpectedly large X.509 certificate files (>1 GB) submitted to certificate parsing utilities or stored in temporary directories.
  • Process: Abnormal termination (SIGSEGV, SIGABRT) of OpenSSL-linked daemons on 32-bit systems shortly after processing an inbound certificate; heap corruption error messages in application logs.

Mitigation and workarounds

Update OpenSSL to the following patched versions: 3.0.20 or later, 3.3.7 or later, 3.4.5 or later, 3.5.6 or later, or 3.6.2 or later. Patches are available via the OpenSSL GitHub repository (commits a242160, 945b935, 364f095, 7a9087e, a91e537) and through downstream distribution advisories (Ubuntu USN-8155-1/2, openSUSE, Debian, Mageia, Slackware, FreeBSD EN-26:15). As a workaround prior to patching, restrict or disable logging and printing of untrusted X.509 certificate contents in affected applications, and prioritize patching 32-bit systems. FIPS module users in versions 3.0, 3.3, 3.4, 3.5, and 3.6 are not affected by this issue (OpenSSL Advisory, Microsoft MSRC).

Community reactions

OpenSSL assigned this vulnerability Low severity due to the impractical exploitation prerequisites (>1 GB certificate, 32-bit platform only), while Feedly's automated CVSS estimate of 9.8 (Critical) reflects the theoretical worst-case impact of a heap buffer overflow with potential code execution. Coverage appeared across Linux security news outlets including 9to5Linux, Linuxiac, HelpNet Security, and CyberSecurityNews shortly after the April 7, 2026 disclosure. Downstream vendors including Ubuntu, openSUSE, Debian, Mageia, FreeBSD, Splunk, Puppet, and Huawei issued their own advisories and updates. Community discussion on Reddit's r/sysadmin noted confusion around Microsoft Defender notifications referencing related OpenSSL CVEs (OpenSSL Advisory, GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related OpenSSL vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-45447HIGH8.8
  • OpenSSL logoOpenSSL
  • libopenssl1_1-32bit
NoYesJun 09, 2026
CVE-2026-11999HIGH8.2
  • OpenSSL logoOpenSSL
  • openssl1.0
NoYesJun 25, 2026
CVE-2026-7383HIGH8.1
  • OpenSSL logoOpenSSL
  • openssl-debuginfo
NoYesJun 09, 2026
CVE-2026-9076HIGH7.5
  • OpenSSL logoOpenSSL
  • libopenssl-1_0_0-devel
NoYesJun 09, 2026
CVE-2026-45784MEDIUM5.1
  • Rust logoRust
  • deno
NoYesJul 17, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management