Executive brief
A vulnerability in the wolfCrypt cryptographic library could allow an attacker to bypass security checks by forging digital signatures (CMAC tags). wolfCrypt is a library used to secure communications and verify data integrity in various applications and embedded devices. If exploited, an attacker could modify data or messages without detection, potentially leading to unauthorized commands or data corruption in systems relying on this library for authentication.
Technical details
An integer overflow exists in the wolfCrypt CMAC implementation within the `wc_CmacUpdate` function. The implementation used a 32-bit counter (`totalSz`) to track processed data; this counter wraps to zero after 4 GiB (2^28 blocks) of data. A conditional guard intended to skip XOR-chaining only on the first block erroneously triggers again upon overflow, causing the library to discard the current CBC-MAC state. This allows an attacker to perform a prefix-substitution forgery where two different messages sharing a common suffix beyond the 4 GiB mark produce identical CMAC tags. The vulnerability is fixed in version 5.9.1 by making the XOR operation unconditional.
Affected products
- wolfSSL wolfSSL up to (including) 5.9.0
Timeline
- 2026-03-30: other: Fix submitted via pull request
- 2026-04-06: patched: Fix merged into master branch
- 2026-04-10: disclosed: CVE-2026-5477 published