LowGHSA-m959-cc7f-wv43CVE-2026-34073PYSEC-2026-35

cryptography has incomplete DNS name constraint enforcement on peer names

Published 27 Mar 2026 · Updated 10 Sept 2026

Is your project on an affected cryptography?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
<46.0.6
Fixed in
46.0.6
Update to the fixed version for your release line, for example:pip install 'cryptography>=46.0.6'

Details

Summary

In versions of cryptography prior to 46.0.5, DNS name constraints were only validated against SANs within child certificates, and not the "peer name" presented during each validation. Consequently, cryptography would allow a peer named bar.example.com to validate against a wildcard leaf certificate for *.example.com, even if the leaf's parent certificate (or upwards) contained an excluded subtree constraint for bar.example.com.

This behavior resulted from a gap between RFC 5280 (which defines Name Constraint semantics) and RFC 9525 (which defines service identity semantics): put together, neither states definitively whether Name Constraints should be applied to peer names. To close this gap, cryptography now conservatively rejects any validation where the peer name would be rejected by a name constraint if it were a SAN instead.

In practice, exploitation of this bypass requires an uncommon X.509 topology, one that the Web PKI avoids because it exhibits these kinds of problems. Consequently, we consider this a medium-to-low impact severity.

See CVE-2025-61727 for a similar bypass in Go's crypto/x509.

Remediation

Users should upgrade to 46.0.6 or newer.

Attribution

Reporter: @1seal

Is GHSA-m959-cc7f-wv43 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected cryptography, and gives you the command that fixes it.

More advisories for cryptography

  • MediumCVE-2026-69248python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees · 3 Aug 2026
  • HighCVE-2026-69249python-cryptography: Duplicate self-signed intermediates can cause exponential path-building · 3 Aug 2026
  • HighCVE-2026-69247cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing · 3 Aug 2026
  • HighGHSA-537c-gmf6-5ccfVulnerable OpenSSL included in cryptography wheels · 15 Jun 2026
  • MediumCVE-2026-39892Cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to APIs · 8 Apr 2026
  • HighCVE-2026-26007cryptography Vulnerable to a Subgroup Attack Due to Missing Subgroup Validation for SECT Curves · 10 Feb 2026
All 24 advisories for cryptography

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.