{"id":"CVE-2026-5295","state":"PUBLISHED","title":"Stack Buffer Overflow in wolfSSL PKCS7 wc_PKCS7_DecryptOri() via Oversized OID","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().","publishedAt":"2026-04-09T22:53:10.635Z","updatedAt":"2026-04-14T14:32:57.454Z","severity":{"score":5.9,"label":"Medium","version":"4.0","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","source":"wolfSSL"},"assigner":"wolfSSL","products":["wolfSSL wolfSSL"],"affected":[{"vendor":"wolfSSL","product":"wolfSSL","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"5.9.1","versionType":"semver"}],"repo":"https://github.com/wolfSSL/wolfssl","programFiles":["wolfcrypt/src/pkcs7.c"]}],"references":["https://github.com/wolfSSL/wolfssl/pull/10116"],"weaknesses":["CWE-121"],"ingestedAt":"2026-10-29T20:12:32.778Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/5xxx/CVE-2026-5295.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-5295","state":"PUBLISHED","datePublished":"2026-04-09T22:53:10.635Z","dateUpdated":"2026-04-14T14:32:57.454Z","assignerShortName":"wolfSSL","assignerOrgId":"50d2cd11-d01a-48ed-9441-5bfce9d63b27","dateReserved":"2026-03-31T23:22:25.201Z"},"containers":{"cna":{"title":"Stack Buffer Overflow in wolfSSL PKCS7 wc_PKCS7_DecryptOri() via Oversized OID","descriptions":[{"lang":"en","value":"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()."}],"affected":[{"vendor":"wolfSSL","product":"wolfSSL","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"5.9.1","versionType":"semver"}],"repo":"https://github.com/wolfSSL/wolfssl","programFiles":["wolfcrypt/src/pkcs7.c"]}],"references":[{"url":"https://github.com/wolfSSL/wolfssl/pull/10116"}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"attackVector":"ADJACENT","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"PASSIVE","vulnConfidentialityImpact":"LOW","subConfidentialityImpact":"NONE","vulnIntegrityImpact":"LOW","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"HIGH","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED","version":"4.0","baseSeverity":"MEDIUM","baseScore":5.9,"vectorString":"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"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-121","lang":"en","description":"CWE-121 Stack-based Buffer Overflow","type":"CWE"}]}],"providerMetadata":{"shortName":"wolfSSL","orgId":"50d2cd11-d01a-48ed-9441-5bfce9d63b27","dateUpdated":"2026-04-09T22:53:10.635Z"},"credits":[{"lang":"en","value":"Sunwoo Lee, (Korea Institute of Energy Technology, KENTECH)","type":"finder"},{"lang":"en","value":"Woohyun Choi, (Korea Institute of Energy Technology, KENTECH)","type":"finder"},{"lang":"en","value":"Seunghyun Yoon, (Korea Institute of Energy Technology, KENTECH)","type":"finder"}],"source":{"discovery":"EXTERNAL"},"x_generator":{"engine":"Vulnogram 1.0.1"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-04-14T14:32:50.288335Z","id":"CVE-2026-5295","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-04-14T14:32:57.454Z"}}]}}}