CVE-2026-5295: Buffer Overflow in wolfSSL

Platform

c

Component

wolfssl

Fixed in

5.9.1

AI Confidence: highNVDEPSS 0.0%Reviewed: May 2026

A critical buffer overflow vulnerability (CVE-2026-5295) has been identified in wolfSSL, specifically within the PKCS7 decryption process. This flaw allows attackers to exploit a stack buffer overflow by crafting malicious CMS EnvelopedData messages. The vulnerability impacts versions 0.0.0 through 5.9.1 of wolfSSL and has been publicly disclosed on 2026-04-09. A fix is available in version 5.9.1.

Impact and Attack Scenarios

The vulnerability lies in the wcPKCS7DecryptOri() function within the pkcs7.c file. When processing CMS EnvelopedData messages with an OtherRecipientInfo (ORI) recipient, the function copies an ASN.1-parsed OID into a fixed 32-byte stack buffer without validating its length. An attacker can exploit this by providing a crafted message containing an OID exceeding 32 bytes, leading to a stack buffer overflow. Successful exploitation could result in denial of service, arbitrary code execution, or information disclosure, depending on the application utilizing wolfSSL. The impact is particularly severe if wolfSSL is used in security-critical applications or embedded systems where memory protection mechanisms are limited.

Exploitation Context

CVE-2026-5295 was publicly disclosed on 2026-04-09. Currently, there are no known public exploits or active campaigns targeting this vulnerability. The vulnerability requires the library to be built with --enable which may limit its immediate exploitability. Its inclusion in the NVD is pending. The EPSS score is currently pending evaluation.

Threat Intelligence

Exploit Status

Proof of ConceptUnknown
CISA KEVNO

EPSS

0.02% (5% percentile)

CISA SSVC

Exploitationnone
Automatableno
Technical Impactpartial

Affected Software

Componentwolfssl
VendorwolfSSL
Affected rangeFixed in
0.0.0 – 5.9.05.9.1

Weakness Classification (CWE)

Timeline

  1. Reserved
  2. Published
  3. Modified
  4. EPSS updated

Mitigation and Workarounds

The primary mitigation is to upgrade to wolfSSL version 5.9.1 or later, which contains the fix for this vulnerability. If an immediate upgrade is not feasible, consider implementing temporary workarounds. Input validation is crucial; carefully scrutinize the length of OIDs received in CMS EnvelopedData messages before processing them. WAFs or proxies can be configured to filter out messages with excessively long OIDs. Building wolfSSL with compiler flags that enable stack protection mechanisms (e.g., stack canaries) can also provide some level of defense. After upgrading, confirm the fix by sending a crafted CMS EnvelopedData message with a long OID and verifying that the overflow no longer occurs.

How to fix

Update to version 5.9.1 or later of wolfSSL to mitigate the stack buffer overflow vulnerability. Ensure the library is compiled with --enable-pkcs7 disabled unless absolutely necessary, and if used, register a custom ORI decrypt callback.

CVE Security Newsletter

Vulnerability analysis and critical alerts directly to your inbox.

Frequently asked questions

What is CVE-2026-5295 — Buffer Overflow in wolfSSL?

CVE-2026-5295 is a buffer overflow vulnerability in wolfSSL's PKCS7 implementation, allowing attackers to trigger a stack overflow with crafted CMS EnvelopedData messages.

Am I affected by CVE-2026-5295 in wolfSSL?

If you are using wolfSSL versions 0.0.0 through 5.9.1 and process CMS EnvelopedData messages, you are potentially affected by this vulnerability.

How do I fix CVE-2026-5295 in wolfSSL?

Upgrade to wolfSSL version 5.9.1 or later to resolve this vulnerability. Implement input validation as a temporary workaround if an upgrade is not immediately possible.

Is CVE-2026-5295 being actively exploited?

As of the current disclosure date, there are no known public exploits or active campaigns targeting CVE-2026-5295.

Where can I find the official wolfSSL advisory for CVE-2026-5295?

Refer to the official wolfSSL security advisory for detailed information and updates regarding CVE-2026-5295. (Link to advisory would be here if available)

Is your project affected?

Upload your dependency file and we'll tell you instantly if this and other CVEs hit you.