
Cloud Vulnerability DB
A community-led vulnerabilities database
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).
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).
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).
buf2hexstr_sep or ossl_buf2hexstr_sep, the buffer size calculation overflows on the 32-bit platform, causing allocation of an undersized heap buffer.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).Certificate handshake messages.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).
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).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."