Vulnerabilities in pkg:pypi/idna

PACKAGE
Advisory Identifier: GHSA-65pc-fj4g-8rjx
Advisory Summary

CVE-2026-45409 is a MODERATE (CVSS 5.3) specially crafted inputs to idna.encode() vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Idna libraries in the PyPI ecosystem. The issue involves specially crafted inputs to idna.encode() can bypass cve-2024-3651 fix. Remediation is available by upgrading affected packages to version 3.15.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/idna

2 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-65pc-fj4g-8rjx CVE-2026-45409 MODERATE Internationalized Domain Names in Applications (IDNA): Specially crafted inputs to idna.encode() can bypass CVE-2024-3651 fix
GHSA-jjg7-2v4v-x38h CVE-2024-3651 MODERATE Internationalized Domain Names in Applications (IDNA) vulnerable to denial of service from specially crafted inputs to idna.encode

CVE-2026-45409 at a Glance

CVE Identifier CVE-2026-45409
GHSA Identifier GHSA-65pc-fj4g-8rjx
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Idna
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:N/A:L).

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 None (I:N)
Availability Low (A:L)

How to Fix CVE-2026-45409

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

idna fixed: 3.15
pip install idna>=3.15
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 idna

How to Check if You Are Affected

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

pip show idna

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Idna, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

This is the same issue as CVE-2024-3651, however the original remediation in 2024 was not a complete fix. Payloads such as `"\u0660" * N` or `"\u30fb" * N + "\u6f22"` utilize the `valid_contexto` function prior to length rejection, and for high values of `N` will take a long time to process. ### Impact A specially crafted argument to the `idna.encode()` function could consume significant resources. This may lead to a denial-of-service. ### Patches Starting in version 3.14, the function rejects long inputs as soon as practicable prior to any further processing to minimize resource consumption. In version 3.15, this approach was extended to lesser used alternate functions (i.e. per-label conversions and codec support). ### Workarounds Domain names cannot exceed 253 characters in length, if this length limit is enforced prior to passing the domain to the `idna.encode()` function it should no longer consume significant resources. This is triggered by arbitrarily large inputs that would not occur in normal usage, but may be passed to the library assuming there is no preliminary input validation by the higher-level application.

CVE-2026-45409 Affected Idna Versions

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

References

Frequently Asked Questions

What is CVE-2026-45409?
CVE-2026-45409 is a security vulnerability in Idna involving Specially crafted inputs to idna.encode() can bypass CVE-2024-3651 fix under CWE-1333: Inefficient Regular Expression Complexity.
Which Idna versions are affected?
Affected versions include releases prior to 3.15 across affected packages: idna.
What version fixes CVE-2026-45409?
Upgrading to 3.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is idna affected?
Yes, idna is affected in releases prior to 3.15. Upgrade your dependency to 3.15 or later.
What is the CVSS score of CVE-2026-45409?
CVE-2026-45409 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2026-45409?
CVE-2026-45409 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check PyPI dependencies for CVE-2026-45409?
Run the dependency tree command: 'pip show idna'. 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-65pc-fj4g-8rjx",
  "modified" : "2026-07-08T17:35:40Z",
  "published" : "2026-05-19T14:34:32Z",
  "aliases" : [ "CVE-2026-45409" ],
  "summary" : "Internationalized Domain Names in Applications (IDNA): Specially crafted inputs to idna.encode() can bypass CVE-2024-3651 fix",
  "details" : "This is the same issue as CVE-2024-3651, however the original remediation in 2024 was not a complete fix. Payloads such as `\"\\u0660\" * N` or `\"\\u30fb\" * N + \"\\u6f22\"` utilize the `valid_contexto` function prior to length rejection, and for high values of `N` will take a long time to process.\n\n### Impact\nA specially crafted argument to the `idna.encode()` function could consume significant resources. This may lead to a denial-of-service.\n\n### Patches\nStarting in version 3.14, the function rejects long inputs as soon as practicable prior to any further processing to minimize resource consumption. In version 3.15, this approach was extended to lesser used alternate functions (i.e. per-label conversions and codec support).\n\n### Workarounds\nDomain names cannot exceed 253 characters in length, if this length limit is enforced prior to passing the domain to the `idna.encode()` function it should no longer consume significant resources. This is triggered by arbitrarily large inputs that would not occur in normal usage, but may be passed to the library assuming there is no preliminary input validation by the higher-level application.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "idna"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.15"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kjd/idna/security/advisories/GHSA-65pc-fj4g-8rjx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45409"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kjd/idna"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/idna/PYSEC-2026-215.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-19T14:34:32Z",
    "nvd_published_at" : "2026-06-05T23:16:43Z"
  }
}