Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
4DescriptionCVE.org
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.
AnalysisAI
Leancrypto library prior to version 1.7.1 allows remote attackers to impersonate X.509 certificate identities by crafting certificates with padded Common Names that exploit integer overflow when casting size_t to uint8_t, enabling spoofing in PKCS#7 verification, certificate chain matching, and code signing scenarios. The vulnerability has a moderate CVSS score of 5.9 (network-accessible, high complexity attack) and is not confirmed in active exploitation, though the attack is technically straightforward once a malicious certificate is crafted.
Technical ContextAI
The leancrypto library is a post-quantum cryptography (PQC) library containing only quantum-resistant algorithms. The vulnerability resides in the lc_x509_extract_name_segment() function, which processes X.509 certificate Distinguished Name fields. The root cause is a type-casting vulnerability (CWE-681: Integer Overflow to Buffer Overflow) where the function casts a size_t variable representing the Common Name (CN) length to uint8_t when storing it. This creates a narrowing conversion: a size_t value of 256 + N bytes becomes (uint8_t)(256 + N) = N due to modulo 256 wrapping. By prepending a victim's CN with 256 bytes of padding in the attacker's certificate, the cn_size field truncates to match only the legitimate CN length, causing the parser to extract only the victim's identity bytes and discard the padding. This affects any code relying on leancrypto's X.509 parsing for certificate validation in PKCS#7 structures, certificate chain verification, and code signing applications.
RemediationAI
Vendor-released patch: upgrade to leancrypto version 1.7.1 or later. The fix is confirmed in the GitHub release tag v1.7.1 and corresponding commit 5cdcbe12bd6c3d6e87e969972a580b44a74c3a6a, which resolves the integer overflow in the size_t to uint8_t cast within lc_x509_extract_name_segment(). Users should update their leancrypto dependency immediately if used in X.509 certificate processing, PKCS#7 verification, or code signing workflows. For immediate containment prior to patching, consider restricting certificate chain validation to trusted, pre-vetted certificates only, or disabling certificate-based authentication where operationally feasible. Refer to the official GitHub security advisory at https://github.com/smuellerDD/leancrypto/security/advisories/GHSA-636g-jxv4-v4gr for detailed patch notes and validation steps.
Same weakness CWE-681 – Incorrect Conversion between Numeric Types
View allSame technique Information Disclosure
View allVendor StatusVendor
SUSE
Severity: Medium| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
| SUSE Linux Enterprise Server 16.0 | Fixed |
| SUSE Linux Enterprise Server 16.1 | Fixed |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Fixed |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Fixed |
| SUSE Linux Micro 6.2 | Fixed |
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-18466