5.9medium
leancrypto: Integer truncation in X.509 name parser enables certificate identity impersonation
- Severity
- 5.9medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.18% (higher than 8% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
Description
The leancrypto library is a cryptographic library that exclusively contains only PQC-resistant cryptographic algorithms. Prior to version 1.7.1, lc_x509_extract_name_segment() casts size_t vlen to uint8_t when storing the Common Name (CN) length. An attacker who crafts a certificate with CN = victim's CN + 256 bytes padding gets cn_size = (uint8_t)(256 + N) = N, where N is the victim's CN length. The first N bytes of the attacker's CN are the victim's identity. After parsing, the attacker's certificate has an identical CN to the victim's — enabling identity impersonation in PKCS#7 verification, certificate chain matching, and code signing. This issue has been patched in version 1.7.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| smuellerDD leancrypto | < 1.7.1 | CVE List |
| leancrypto leancrypto | before 1.7.1 | NVD |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
The leancrypto library is a cryptographic library that exclusively contains only PQC-resistant cryptographic algorithms. Prior to version 1.7.1, lc_x509_extract_name_segment() casts size_t vlen to uint8_t when storing the Common Name (CN) length. An attacker who crafts a certificate with CN = victim's CN + 256 bytes padding gets cn_size = (uint8_t)(256 + N) = N, where N is the victim's CN length. The first N bytes of the attacker's CN are the victim's identity. After parsing, the attacker's certificate has an identical CN to the victim's — enabling identity impersonation in PKCS#7 verification, certificate chain matching, and code signing. This issue has been patched in version 1.7.1.
NVD (es)
La biblioteca leancrypto es una biblioteca criptográfica que contiene exclusivamente algoritmos criptográficos resistentes a PQC. Antes de la versión 1.7.1, lc_x509_extract_name_segment() realiza un 'cast' de size_t vlen a uint8_t al almacenar la longitud del Nombre Común (CN). Un atacante que elabora un certificado con CN = CN de la víctima + relleno de 256 bytes obtiene cn_size = (uint8_t)(256 + N) = N, donde N es la longitud del CN de la víctima. Los primeros N bytes del CN del atacante son la identidad de la víctima. Después del análisis, el certificado del atacante tiene un CN idéntico al de la víctima - lo que permite la suplantación de identidad en la verificación PKCS#7, la coincidencia de cadenas de certificados y la firma de código. Este problema ha sido parcheado en la versión 1.7.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-34610 changed 2026-04-03 | CVE Terms of Use |
| NVD | CVE-2026-34610 changed 2026-07-24 | Public domain |