REDHAT-BUG-2510830: Medium severity pypi/cryptography vulnerability
cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. Prior to 49.0.0, if an intermediate constrained CA permits the DNS name foo.example.com, and the leaf certificate has a wildcard in its DNS SAN of .example.com, python-cryptography's verifier accepts which allows escaping outside of the permitted names. The core issue is in DNSConstraint::matches, where a wildcard pattern was treated as matching a more-specific permitted constraint even though .example.com can expand to sibling names such as bar.example.com outside foo.example.com. This allows acceptance of an invalid certificate chain. This issue is fixed in 49.0.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
cryptographyto a version that resolves this vulnerability.Fixed in 49.0.0
Event History
Frequently Asked Questions
Who is exposed to this certificate-validation issue?
Applications using python-cryptography versions prior to 49.0.0 are affected when they verify certificate chains containing an intermediate CA with DNS name constraints and a leaf certificate that uses a wildcard DNS SAN. The problematic case requires a permitted constraint such as foo.example.com and a wildcard leaf SAN such as *.example.com.
What does an attacker need to exploit it?
An attacker needs to present an invalid certificate chain in which a constrained intermediate CA permits a more-specific DNS name but the leaf certificate contains a wildcard that can cover sibling names outside that permitted name. The verifier may incorrectly accept that chain.
What is the remediation?
Upgrade python-cryptography to version 49.0.0 or later, where the DNS constraint wildcard matching issue is fixed.