{"id":"CVE-2026-5477","state":"PUBLISHED","title":"Prefix-substitution forgery via integer overflow in wolfCrypt CMAC","description":"An integer overflow existed in the wolfCrypt CMAC implementation, that could be exploited to forge CMAC tags. The function wc_CmacUpdate used the guard `if (cmac->totalSz != 0)` to skip XOR-chaining on the first block (where digest is all-zeros and the XOR is a no-op). However, totalSz is word32 and wraps to zero after 2^28 block flushes (4 GiB), causing the guard to erroneously discard the live CBC-MAC chain state. Any two messages sharing a common suffix beyond the 4 GiB mark then produce identical CMAC tags, enabling a zero-work prefix-substitution forgery. The fix removes the guard, making the XOR unconditional; the no-op property on the first block is preserved because digest is zero-initialized by wc_InitCmac_ex.","publishedAt":"2026-04-10T05:06:22.884Z","updatedAt":"2026-04-10T14:04:00.411Z","severity":{"score":8.2,"label":"High","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/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","lessThanOrEqual":"5.9.0","versionType":"semver"}],"modules":["wc_CmacUpdate"],"programFiles":["wolfcrypt/src/cmac.c","wolfcrypt/src/aes.c"]}],"references":["https://github.com/wolfSSL/wolfssl/pull/10102"],"weaknesses":["CWE-190"],"ingestedAt":"2026-10-29T20:12:32.778Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/5xxx/CVE-2026-5477.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-5477","state":"PUBLISHED","datePublished":"2026-04-10T05:06:22.884Z","dateUpdated":"2026-04-10T14:04:00.411Z","assignerShortName":"wolfSSL","assignerOrgId":"50d2cd11-d01a-48ed-9441-5bfce9d63b27","dateReserved":"2026-04-03T07:59:59.388Z"},"containers":{"cna":{"title":"Prefix-substitution forgery via integer overflow in wolfCrypt CMAC","descriptions":[{"lang":"en","value":"An integer overflow existed in the wolfCrypt CMAC implementation, that could be exploited to forge CMAC tags. The function wc_CmacUpdate used the guard `if (cmac->totalSz != 0)` to skip XOR-chaining on the first block (where digest is all-zeros and the XOR is a no-op). However, totalSz is word32 and wraps to zero after 2^28 block flushes (4 GiB), causing the guard to erroneously discard the live CBC-MAC chain state. Any two messages sharing a common suffix beyond the 4 GiB mark then produce identical CMAC tags, enabling a zero-work prefix-substitution forgery. The fix removes the guard, making the XOR unconditional; the no-op property on the first block is preserved because digest is zero-initialized by wc_InitCmac_ex."}],"affected":[{"vendor":"wolfSSL","product":"wolfSSL","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThanOrEqual":"5.9.0","versionType":"semver"}],"modules":["wc_CmacUpdate"],"programFiles":["wolfcrypt/src/cmac.c","wolfcrypt/src/aes.c"]}],"references":[{"url":"https://github.com/wolfSSL/wolfssl/pull/10102"}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","subConfidentialityImpact":"NONE","vulnIntegrityImpact":"HIGH","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"NONE","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":"HIGH","baseScore":8.2,"vectorString":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-190","lang":"en","description":"CWE-190 Integer overflow or wraparound","type":"CWE"}]}],"providerMetadata":{"shortName":"wolfSSL","orgId":"50d2cd11-d01a-48ed-9441-5bfce9d63b27","dateUpdated":"2026-04-10T05:06:22.884Z"},"credits":[{"lang":"en","value":"Calif.io in collaboration with Claude and Anthropic Research","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-10T14:03:53.265423Z","id":"CVE-2026-5477","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-04-10T14:04:00.411Z"}}]}}}