CVE-2026-34073: Cryptography Remote Code Execution Vulnerability

LOW
Advisory Identifier: GHSA-m959-cc7f-wv43
CVSS 5.3
CWE-295
Published
Advisory Summary

CVE-2026-34073 is a LOW (CVSS 5.3) remote code execution vulnerability (CWE-295: Improper Certificate Validation) affecting Cryptography libraries in the PyPI ecosystem. The issue involves cryptography has incomplete dns name constraint enforcement on peer names. Remediation is available by upgrading affected packages to version 46.0.6.

CVE-2026-34073 at a Glance

CVE Identifier CVE-2026-34073
GHSA Identifier GHSA-m959-cc7f-wv43
Severity LOW
CVSS v3.1 Base Score 5.3
CWE Classification CWE-295: Improper Certificate Validation
Affected Product Cryptography
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-34073

To remediate this vulnerability, upgrade all affected Cryptography dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

cryptography fixed: 46.0.6
pip install cryptography>=46.0.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show cryptography

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-34073, inspect your installed packages using pip:

pip show cryptography

Analyze the terminal output to locate any version of Cryptography in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 46.0.6), your application is affected.

Note: The pip show cryptography command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & RFC 5280 Specification

Under RFC 5280 specifications for X.509 certificates, the Name Constraints extension defines a namespace within which all subsequent subject names in a certification path must be located. Constraints apply to various name forms including directory names, IP addresses, rfc822Name (email addresses), and uniformResourceIdentifier (URI) entries. Specifically, during certificate path validation, affected versions of Cryptography failed to properly normalize or enforce boundary checks when domain names contained trailing dot (.) characters. Because domain names with a trailing dot signify fully qualified domain names (FQDNs), this omission allowed non-conforming certificates to be improperly validated as compliant with the defined name constraints.

Source Advisory Statement

## 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

CVE-2026-34073 Affected Cryptography Versions

1 component(s)
Fixed Versions:
46.0.6
Product / Package Ecosystem Affected Versions Fixed Version
cryptography
PyPI
< 46.0.6
46.0.6

References

Frequently Asked Questions

What is CVE-2026-34073?
CVE-2026-34073 is a security vulnerability in Cryptography involving cryptography has incomplete DNS name constraint enforcement on peer names under CWE-295: Improper Certificate Validation.
Which Cryptography versions are affected?
Affected versions include releases prior to 46.0.6 across affected packages: cryptography.
What version fixes CVE-2026-34073?
Upgrading to 46.0.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cryptography affected?
Yes, cryptography is affected in releases prior to 46.0.6. Upgrade your dependency to 46.0.6 or later.
What is the CVSS score of CVE-2026-34073?
CVE-2026-34073 has a CVSS v3.1 base score of 5.3 (LOW) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-34073?
CVE-2026-34073 is classified under CWE-295: Improper Certificate Validation (The product does not validate, or incorrectly validates, a certificate.).
How can I check PyPI dependencies for CVE-2026-34073?
Run the dependency tree command: 'pip show cryptography'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m959-cc7f-wv43",
  "modified" : "2026-06-05T17:51:29Z",
  "published" : "2026-03-27T19:56:21Z",
  "aliases" : [ "CVE-2026-34073" ],
  "summary" : "cryptography has incomplete DNS name constraint enforcement on peer names",
  "details" : "## Summary\n\nIn 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`.\n\nThis 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.\n\nIn 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.\n\nSee CVE-2025-61727 for a similar bypass in Go's `crypto/x509`.\n\n## Remediation\n\nUsers should upgrade to 46.0.6 or newer. \n\n## Attribution\n\nReporter: @1seal",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "cryptography"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "46.0.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pyca/cryptography/security/advisories/GHSA-m959-cc7f-wv43"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34073"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pyca/cryptography"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2026-35.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-295" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-27T19:56:21Z",
    "nvd_published_at" : "2026-03-31T03:15:59Z"
  }
}