CVE-2026-45409: Idna Specially Crafted Inputs To Idna.encode() Vulnerability
MODERATECVE-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.
CVE-2026-45409 at a Glance
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).
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.
pip install idna>=3.15
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
CVE-2026-45409 Affected Idna Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
idna
|
PyPI |
< 3.15
|
3.15
|
References
Frequently Asked Questions
What is CVE-2026-45409?
Which Idna versions are affected?
What version fixes CVE-2026-45409?
Is idna affected?
What is the CVSS score of CVE-2026-45409?
What CWE is associated with CVE-2026-45409?
How can I check PyPI dependencies for CVE-2026-45409?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}