Impact
The cryptography package, a widely used Python library for cryptographic operations, previously enforced DNS name constraints only against the subject‑alternative names in child certificates. It failed to validate the exact peer name supplied during a connection. This omission allowed an attacker to present a certificate chain that included a wildcard leaf certificate such as *.example.com while the parent certificate contained an excluded subtree constraint matching the intended peer, for example bar.example.com. The flaw represents a Name Constraint Missing Validation weakness (CWE‑295) and enables domain spoofing that could be used in man‑in‑the‑middle attacks against Python applications that rely on cryptography for TLS/SSL validation.
Affected Systems
All installations of the pyca:cryptography library that are older than version 46.0.6 and are employed for TLS or other certificate validation in Python applications are vulnerable. The issue applies to any code path that loads certificates via cryptography and performs hostname checking using the library's validation routines.
Risk and Exploitability
The CVSS score of 1.7 indicates a low severity risk, and the EPSS score of less than 1% suggests exploitation is unlikely at scale. The vulnerability is not listed in the CISA KEV catalog. Based on the description, it is inferred that the attacker must supply a crafted certificate chain that contains a wildcard leaf certificate matching the peer name while the parent certificate enforces an excluded subtree that matches the same name. Consequently, the exploit requires control over the certificate chain presented to the application or the ability to influence how the peer name is sent during the TLS handshake. The impact is limited to domain spoofing and does not provide remote code execution or broader system compromise.
OpenCVE Enrichment
Github GHSA