CVE-2026-5295

Stack Buffer Overflow in wolfSSL PKCS7 wc_PKCS7_DecryptOri() via Oversized OID

Published Apr 9, 2026 CVSS 4.0 · 5.9 Medium EPSS < 1% KEV · Not listed
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().

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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 available
History
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'}

Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Wolfssl
Wolfssl wolfssl
Vendors & Products Wolfssl
Wolfssl wolfssl
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'}

Weaknesses
  • CWE-121

    Stack-based Buffer Overflow

Sources

Status
PUBLISHED
Assigner
wolfSSL
Published
Updated
Apr 14, 2026, 2:32 PM
Reserved
Mar 31, 2026, 11:22 PM
Status
Analyzed
Published
Apr 9, 2026, 11:17 PM
Modified
Jun 17, 2026, 10:58 AM