CVE-2026-4159
wolfSSL vulnerability analysis and mitigation

Overview

CVE-2026-4159 is a 1-byte out-of-bounds heap read vulnerability in wolfSSL's wc_PKCS7_DecodeEnvelopedData() function, triggered by a crafted CMS EnvelopedData message with zero-length encrypted content. It affects wolfSSL versions 5.8.4 and earlier (all versions before 5.9.0). The vulnerability was published on March 19, 2026, and a fix was merged on March 11, 2026. It carries a CVSS v3.1 base score of 3.3 (Low) and a CVSS v4.0 base score of 1.2 (Low) (Red Hat Advisory, wolfSSL PR #9945).

Technical details

The root cause is an out-of-bounds read (CWE-125) in the wc_PKCS7_DecodeEnvelopedData() function, where the code reads one byte beyond the allocated buffer when processing a CMS EnvelopedData message that contains zero-length encrypted content. The attack vector is local, requiring low privileges, and specific preconditions must be met: the application must have PKCS7 support explicitly enabled (it is disabled by default in wolfSSL) and must process attacker-controlled EnvelopedData messages. The fix, contributed by holtrop-wolfssl and merged into the wolfSSL master branch on March 11, 2026, adds a bounds check to prevent the erroneous single-byte read (wolfSSL PR #9945).

Impact

Successful exploitation can cause a denial-of-service condition through application crash or instability due to the 1-byte heap read beyond the allocated buffer. There is no confidentiality or integrity impact, as the vulnerability does not expose sensitive data or allow memory writes. The limited scope (local access, PKCS7 must be enabled, low-privilege attacker) significantly constrains the real-world impact (Red Hat Advisory).

Exploitation steps

  1. Precondition check: Confirm the target application uses wolfSSL ≤ 5.8.4 with PKCS7 support explicitly compiled in (non-default configuration).
  2. Craft malicious EnvelopedData: Construct a CMS EnvelopedData ASN.1 structure where the encryptedContent field is present but has a zero-length value (e.g., an OCTET STRING of length 0).
  3. Deliver the message: Supply the crafted EnvelopedData to the target application through any local input channel that passes data to wc_PKCS7_DecodeEnvelopedData() (e.g., a file, IPC message, or local socket).
  4. Trigger OOB read: The function reads one byte past the end of the allocated encrypted content buffer, potentially causing a crash or undefined behavior, resulting in a denial-of-service condition (wolfSSL PR #9945).

Indicators of compromise

  • Logs: Application crash logs or core dumps referencing wc_PKCS7_DecodeEnvelopedData in the stack trace; heap sanitizer (ASan/Valgrind) reports of a 1-byte out-of-bounds read in wolfSSL's PKCS7 code path.
  • Process: Unexpected termination (SIGSEGV or SIGABRT) of processes using wolfSSL with PKCS7 enabled when processing externally supplied CMS messages.
  • File System: Presence of core dump files associated with wolfSSL-linked applications after processing EnvelopedData inputs.

Mitigation and workarounds

Upgrade wolfSSL to version 5.9.0 or later, which includes the fix merged on March 11, 2026 (wolfSSL PR #9945). If immediate patching is not feasible, ensure PKCS7 support remains disabled (the default configuration) — do not enable it unless strictly required. Additionally, restrict local system access to trusted users and limit the ability of untrusted users to supply CMS EnvelopedData messages to affected applications (Red Hat Advisory).

Community reactions

The vulnerability received routine automated coverage across CVE tracking platforms and security feeds shortly after publication on March 19, 2026. Red Hat acknowledged the CVE in their security advisory portal. No notable researcher commentary, vendor blog posts, or significant social media discussion beyond automated CVE notifications has been identified for this low-severity issue (Red Hat Advisory).

Additional resources


SourceThis report was generated using AI

Related wolfSSL vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-6330MEDIUM6.3
  • wolfSSL logowolfSSL
  • wolfssl
NoYesJun 25, 2026
CVE-2026-8720MEDIUM5.9
  • wolfSSL logowolfSSL
  • wolfssl
NoYesJun 25, 2026
CVE-2026-7511MEDIUM5.9
  • wolfSSL logowolfSSL
  • cpe:2.3:a:wolfssl:wolfssl
NoYesJun 25, 2026
CVE-2026-7532MEDIUM5.7
  • wolfSSL logowolfSSL
  • wolfssl
NoYesJun 25, 2026
CVE-2026-6331LOW2.1
  • wolfSSL logowolfSSL
  • cpe:2.3:a:wolfssl:wolfssl
NoYesJun 25, 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