Impact
The vulnerable function in leancrypto cast a size_t length to a uint8_t when storing the Common Name length in a certificate. An attacker can supply a CN field that is 256 bytes longer than the victim’s CN. Because the high byte is truncated, the parsed length wraps to the victim’s CN length and the first N bytes of the attacker’s CN match the victim’s name. The resulting certificate appears to have the victim’s identity, allowing an attacker to forge PKCS#7 signatures, bypass certificate chain matching, or sign code that will be trusted as the victim. The weakness is an integer truncation error controlled by attacker‑supplied certificate data, creating the possibility of certificate impersonation. The exploit requires constructing a malicious certificate; the attacker can embed this certificate in any PKCS#7 or code‑signing workflow that relies on leancrypto for name parsing. The risk is limited to environments that use this library for certificate handling, and the impact is on confidentiality and integrity of signed data. Affected systems are those using smuellerDD:leancrypto prior to version 1.7.1. The patch was applied in v1.7.1, restoring proper size handling for CN lengths. Severity is moderate with a CVSS score of 5.9, no EPSS data is available, and the vulnerability is not listed in CISA’s KEV catalog. The likely attack vector is a crafted certificate presented to an application that uses leancrypto for verification.
Affected Systems
Products: leancrypto library by smuellerDD. Versions before v1.7.1 are affected. The CVE affects any deployment of leancrypto that performs X.509 CN parsing.
Risk and Exploitability
The CVSS score of 5.9 indicates moderate risk. Exploitation requires the attacker to create a certificate with a Common Name padded by 256 bytes, which can be done offline. Because the vulnerability is only in name parsing, lateral movement or system compromise requires the attacker to force certificate verification in the target application. No public exploits are known, and the vulnerability is not catalogued in KEV. However, the ability to impersonate a certificate authority or sign code means potential for significant damage if the library is used in security-sensitive contexts.
OpenCVE Enrichment