Description
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.
Published: 2026-08-03
Score: 6.9 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability lies in the DNSConstraint::matches function of the python-cryptography library, where a wildcard domain pattern (*.example.com) was incorrectly considered a match for a more specific permitted subtree such as foo.example.com. This flaw allows an attacker to supply a certificate chain that includes a wildcard entry seemingly valid under the intermediate CA but actually permitting sibling names like bar.example.com, thereby escaping the intended name constraints. The result is the acceptance of an invalid certificate chain, potentially enabling impersonation or man‑in‑the‑middle attacks. The weakness is a CWE‑295 type error in authorization logic.

Affected Systems

The python-cryptography package developed by the PyCA project is affected for all releases prior to version 49.0.0. Any application or service that imports this library for TLS/SSL certificate verification and is running an older version is vulnerable.

Risk and Exploitability

The CVSS score of 6.9 indicates a medium severity vulnerability, and although the EPSS score is not available, the flaw is not listed in the CISA KEV catalog. Exploitation is likely to occur in environments where python-cryptography performs hostname verification for TLS connections; an attacker who can supply a crafted certificate chain to a vulnerable application can cause the library to accept a chain that should be rejected, leading to unauthorized access or data compromise. The attack vector is inferred to be remote through application traffic that establishes TLS sessions using this library.

Generated by OpenCVE AI on August 4, 2026 at 20:43 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the python-cryptography library to version 49.0.0 or newer.
  • Ensure your application still performs hostname verification and does not suppress errors from the cryptography verifier; add explicit checks if your TLS stack permits flexible matching.
  • Configure or modify your application's TLS settings to enforce strict name constraint enforcement, preventing wildcard domain names from matching sibling domains outside the allowed subtree.

Generated by OpenCVE AI on August 4, 2026 at 20:43 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-m2h6-j472-rp4c python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees
History

Tue, 04 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 03 Aug 2026 22:45:00 +0000

Type Values Removed Values Added
First Time appeared Pyca
Pyca cryptography
Vendors & Products Pyca
Pyca cryptography

Mon, 03 Aug 2026 21:45:00 +0000

Type Values Removed Values Added
Description 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.
Title python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees
Weaknesses CWE-295
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N/E:P'}


Subscriptions

Pyca Cryptography
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-04T15:04:51.587Z

Reserved: 2026-08-03T19:54:19.852Z

Link: CVE-2026-69248

cve-icon Vulnrichment

Updated: 2026-08-04T13:34:42.076Z

cve-icon NVD

Status : Received

Published: 2026-08-03T22:16:52.550

Modified: 2026-08-04T16:16:28.730

Link: CVE-2026-69248

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-04T20:45:03Z

Weaknesses
  • CWE-295

    Improper Certificate Validation