{"id":"CVE-2026-0819","state":"PUBLISHED","title":"Stack buffer overflow in PKCS7 SignedData encoding with custom signed attributes","description":"A stack buffer overflow vulnerability exists in wolfSSL's PKCS7 SignedData encoding functionality. In wc_PKCS7_BuildSignedAttributes(), when adding custom signed attributes, the code passes an incorrect capacity value (esd->signedAttribsCount) to EncodeAttributes() instead of the remaining available space in the fixed-size signedAttribs[7] array. When an application sets pkcs7->signedAttribsSz to a value greater than MAX_SIGNED_ATTRIBS_SZ (default 7) minus the number of default attributes already added, EncodeAttributes() writes beyond the array bounds, causing stack memory corruption. In WOLFSSL_SMALL_STACK builds, this becomes heap corruption. Exploitation requires an application that allows untrusted input to control the signedAttribs array size when calling wc_PKCS7_EncodeSignedData() or related signing functions.","publishedAt":"2026-03-19T16:54:33.442Z","updatedAt":"2026-03-19T17:19:37.134Z","severity":{"score":2.2,"label":"Low","version":"4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:U","source":"wolfSSL"},"assigner":"wolfSSL","products":["wolfSSL wolfSSL"],"affected":[{"vendor":"wolfSSL","product":"wolfSSL","defaultStatus":"unaffected","versions":[{"version":"5.5.0","status":"affected","lessThan":"5.9.0","versionType":"semver"}],"repo":"https://github.com/wolfSSL/wolfssl","modules":["wolfcrypt PKCS7"],"programFiles":["wolfcrypt/src/pkcs7.c"],"programRoutines":[{"name":"wc_PKCS7_EncodeSignedData()"}]}],"references":["https://github.com/wolfSSL/wolfssl/pull/9630"],"weaknesses":["CWE-121","CWE-787"],"ingestedAt":"2026-10-29T20:10:13.529Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/0xxx/CVE-2026-0819.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-0819","state":"PUBLISHED","datePublished":"2026-03-19T16:54:33.442Z","dateUpdated":"2026-03-19T17:19:37.134Z","assignerShortName":"wolfSSL","assignerOrgId":"50d2cd11-d01a-48ed-9441-5bfce9d63b27","dateReserved":"2026-01-09T17:04:43.340Z"},"containers":{"cna":{"title":"Stack buffer overflow in PKCS7 SignedData encoding with custom signed attributes","descriptions":[{"lang":"en","value":"A stack buffer overflow vulnerability exists in wolfSSL's PKCS7 SignedData encoding functionality. In wc_PKCS7_BuildSignedAttributes(), when adding custom signed attributes, the code passes an incorrect capacity value (esd->signedAttribsCount) to EncodeAttributes() instead of the remaining available space in the fixed-size signedAttribs[7] array. When an application sets pkcs7->signedAttribsSz to a value greater than MAX_SIGNED_ATTRIBS_SZ (default 7) minus the number of default attributes already added, EncodeAttributes() writes beyond the array bounds, causing stack memory corruption. In WOLFSSL_SMALL_STACK builds, this becomes heap corruption. Exploitation requires an application that allows untrusted input to control the signedAttribs array size when calling wc_PKCS7_EncodeSignedData() or related signing functions."}],"affected":[{"vendor":"wolfSSL","product":"wolfSSL","defaultStatus":"unaffected","versions":[{"version":"5.5.0","status":"affected","lessThan":"5.9.0","versionType":"semver"}],"repo":"https://github.com/wolfSSL/wolfssl","modules":["wolfcrypt PKCS7"],"programFiles":["wolfcrypt/src/pkcs7.c"],"programRoutines":[{"name":"wc_PKCS7_EncodeSignedData()"}]}],"references":[{"url":"https://github.com/wolfSSL/wolfssl/pull/9630","name":"GitHub Pull Request"}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"attackVector":"LOCAL","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","subConfidentialityImpact":"NONE","vulnIntegrityImpact":"HIGH","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"HIGH","subAvailabilityImpact":"NONE","exploitMaturity":"UNREPORTED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED","version":"4.0","baseSeverity":"LOW","baseScore":2.2,"vectorString":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:U"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-121","lang":"en","description":"CWE-121: Stack-based Buffer Overflow","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-787","lang":"en","description":"CWE-787: Out-of-bounds Write","type":"CWE"}]}],"providerMetadata":{"shortName":"wolfSSL","orgId":"50d2cd11-d01a-48ed-9441-5bfce9d63b27","dateUpdated":"2026-03-19T16:54:33.442Z"},"impacts":[{"descriptions":[{"lang":"en","value":"Overflow Buffers"}]}],"workarounds":[{"lang":"en","value":"Ensure that applications using wolfSSL PKCS7 signing functionality validate and limit the number of custom signed attributes (signedAttribsSz) to no more than MAX_SIGNED_ATTRIBS_SZ (default 7) minus the number of default signed attributes enabled. Do not allow untrusted input to control the signedAttribs array or its size.","supportingMedia":[{"type":"text/html","base64":false,"value":"<p>Ensure that applications using wolfSSL PKCS7 signing functionality validate and limit the number of custom signed attributes (signedAttribsSz) to no more than MAX_SIGNED_ATTRIBS_SZ (default 7) minus the number of default signed attributes enabled. Do not allow untrusted input to control the signedAttribs array or its size.</p>"}]}],"solutions":[{"lang":"en","value":"Update to the patched version of wolfSSL. The fix adds proper bounds checking in wc_PKCS7_BuildSignedAttributes() to validate that the number of custom signed attributes does not exceed the available space in the fixed-size signedAttribs array, returning BUFFER_E if the limit is exceeded.","supportingMedia":[{"type":"text/html","base64":false,"value":"<p>Update to the patched version of wolfSSL. The fix adds proper bounds checking in wc_PKCS7_BuildSignedAttributes() to validate that the number of custom signed attributes does not exceed the available space in the fixed-size signedAttribs array, returning BUFFER_E if the limit is exceeded.</p>"}]}],"credits":[{"lang":"en","value":"Maor Caplan","type":"finder"}],"source":{"discovery":"EXTERNAL"},"x_generator":{"engine":"Vulnogram 0.5.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-03-19T17:19:26.928139Z","id":"CVE-2026-0819","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-03-19T17:19:37.134Z"}}]}}}