Description
A stack buffer overflow exists in wolfSSL's PKCS7 implementation in the wc_PKCS7_DecryptOri() function in wolfcrypt/src/pkcs7.c. When processing a CMS EnvelopedData message containing an OtherRecipientInfo (ORI) recipient, the function copies an ASN.1-parsed OID into a fixed 32-byte stack buffer (oriOID[MAX_OID_SZ]) via XMEMCPY without first validating that the parsed OID length does not exceed MAX_OID_SZ. A crafted CMS EnvelopedData message with an ORI recipient containing an OID longer than 32 bytes triggers a stack buffer overflow. Exploitation requires the library to be built with --enable-pkcs7 (disabled by default) and the application to have registered an ORI decrypt callback via wc_PKCS7_SetOriDecryptCb().
Published: 2026-04-09
Score: 5.9 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

A stack buffer overflow exists in the PKCS7 decryption routine of the wolfSSL library. When a CMS EnvelopedData message contains an OtherRecipientInfo (ORI) entry with an object identifier longer than 32 bytes, the library copies the ASN.1‑parsed OID into a 32‑byte stack buffer without bounds checking. This overflow can corrupt the stack and potentially allow an attacker to execute arbitrary code or crash the application, compromising confidentiality, integrity, and availability.

Affected Systems

Affected systems are applications that link against wolfSSL and have PKCS#7 support enabled (the optional --enable-pkcs7 flag). The vulnerability only manifests if the application has registered an ORI decrypt callback via wc_PKCS7_SetOriDecryptCb(). The specific version ranges are not listed, so any build that satisfies these conditions prior to the fix is at risk.

Risk and Exploitability

The severity is classified as a CVSS score of 5.9, indicating moderate risk. EPSS is not available, and the vulnerability is not listed in the CISA KEV catalog, suggesting that widespread exploitation may not have been observed yet. The required preconditions—building the library with PKCS#7 enabled and registering a callback—raise the complexity, but once those are in place, exploiting the overflow is feasible. Organizations should treat this as a potential code‑execution risk and apply the fix promptly.

Generated by OpenCVE AI on April 10, 2026 at 00:23 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update wolfSSL to the latest release that includes the fix from pull request 10116.
  • If an update is not immediately available, rebuild the library without the --enable-pkcs7 option or remove any ORI decrypt callbacks from the application.
  • Verify that the application is no longer processing CMS EnvelopedData messages with oversized OIDs or that the callback is disabled.

Generated by OpenCVE AI on April 10, 2026 at 00:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 29 Apr 2026 14:15:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:wolfssl:wolfssl:*:*:*:*:*:*:*:*
Metrics cvssV3_1

{'score': 8.0, 'vector': 'CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}


Tue, 14 Apr 2026 15:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 10 Apr 2026 09:00:00 +0000

Type Values Removed Values Added
First Time appeared Wolfssl
Wolfssl wolfssl
Vendors & Products Wolfssl
Wolfssl wolfssl

Thu, 09 Apr 2026 23:15:00 +0000

Type Values Removed Values Added
Description A stack buffer overflow exists in wolfSSL's PKCS7 implementation in the wc_PKCS7_DecryptOri() function in wolfcrypt/src/pkcs7.c. When processing a CMS EnvelopedData message containing an OtherRecipientInfo (ORI) recipient, the function copies an ASN.1-parsed OID into a fixed 32-byte stack buffer (oriOID[MAX_OID_SZ]) via XMEMCPY without first validating that the parsed OID length does not exceed MAX_OID_SZ. A crafted CMS EnvelopedData message with an ORI recipient containing an OID longer than 32 bytes triggers a stack buffer overflow. Exploitation requires the library to be built with --enable-pkcs7 (disabled by default) and the application to have registered an ORI decrypt callback via wc_PKCS7_SetOriDecryptCb().
Title Stack Buffer Overflow in wolfSSL PKCS7 wc_PKCS7_DecryptOri() via Oversized OID
Weaknesses CWE-121
References
Metrics cvssV4_0

{'score': 5.9, 'vector': 'CVSS:4.0/AV:A/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: wolfSSL

Published:

Updated: 2026-04-14T14:32:57.454Z

Reserved: 2026-03-31T23:22:25.201Z

Link: CVE-2026-5295

cve-icon Vulnrichment

Updated: 2026-04-14T14:32:53.734Z

cve-icon NVD

Status : Analyzed

Published: 2026-04-09T23:17:01.093

Modified: 2026-04-29T14:08:46.683

Link: CVE-2026-5295

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-10T09:27:32Z

Weaknesses