MEDIUM 5.3

CVE-2026-45409: Denial-of-Service in Python IDNA Library via Resource Exhaustion

The Python IDNA library, which handles internationalized domain names, has a resource-exhaustion vulnerability that allows attackers to cause denial-of-service by sending specially crafted, extremely long domain names to the idna.encode() function. The vulnerability stems from the library processing certain Unicode patterns through validation logic before rejecting them as too long—a process that can consume significant CPU and memory for large inputs. This is a regression: the same issue was supposedly patched in 2024 (CVE-2024-3651), but the fix was incomplete and only addressed some code paths. Version 3.15 extends the complete fix to all relevant functions. Under normal circumstances, domain names are limited to 253 characters, so legitimate applications are unaffected. The risk exists primarily when applications pass unvalidated, arbitrarily large input directly to the library.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.3 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weaknesses (CWE)
CWE-1333
Affected products
1 configuration(s)
Published / Modified
2026-06-05 / 2026-06-17

NVD description (verbatim)

Internationalized Domain Names in Applications (IDNA) for Python provides support for Internationalized Domain Names in Applications (IDNA) and Unicode IDNA Compatibility Processing. In versions prior to 3.15, 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. This is the same issue as CVE-2024-3651, however the original remediation in 2024 was not a complete fix. A specially crafted argument to the `idna.encode()` function could consume significant resources. This may lead to a denial-of-service. 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). A workaround is available. 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.

1 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-45409 is a denial-of-service vulnerability in the kjd/idna Python library caused by algorithmic inefficiency in the valid_contexto validation function. Payloads such as repeated Unicode characters (e.g., '\u0660' repeated N times or '\u30fb' repeated N times followed by '\u6f22') trigger expensive processing even before length validation rejects them. The CVSS 3.1 score of 5.3 reflects network-accessible attack surface with no authentication required and low impact (availability only). The vulnerability affects versions prior to 3.14 (which added early length rejection) and persists in alternate code paths until version 3.15. The issue is classified under CWE-1333 (Inefficient Regular Expression Complexity), though the root cause is pre-length validation resource consumption rather than regex backtracking per se. Workaround: enforce a 253-character length limit at the application layer before calling idna.encode().

Business impact

Organizations using the Python IDNA library in internet-facing applications without upstream input validation may experience service degradation if an attacker sends specially crafted domain names. The impact is limited to availability; no data confidentiality or integrity is compromised. Libraries that depend on idna (DNS resolvers, email validators, web frameworks) are potential vectors. Most affected will be services that accept arbitrary domain input—such as DNS query tools, domain registration validators, or email address processors—without length validation. The MEDIUM severity and low CVSS score reflect that this requires attacker control over domain input and that the impact is denial-of-service rather than code execution or data exposure. However, in multi-tenant or public-facing SaaS scenarios, attackers could degrade service for other users.

Affected systems

The vulnerability affects Python applications using the kjd internationalized_domain_names_in_applications (idna) library in versions prior to 3.14 for the primary attack surface, and prior to 3.15 for complete remediation across all function variants (per-label conversions and codec support). Any service or library that accepts domain names or email addresses and passes them to idna.encode() without preliminary length validation is at risk. This includes DNS clients, email validators, domain whitelisting tools, and any web framework or middleware that processes domain inputs. Applications running version 3.15 or later are not vulnerable. Versions 3.14 and later have partial mitigation; verify whether your dependency chain uses only the primary encode() path or also calls the alternate functions (codec or per-label APIs).

Exploitability

Exploitability is straightforward: an attacker needs only network access to submit a specially crafted domain name to a vulnerable endpoint. No authentication, user interaction, or privileges are required. The attack is deterministic—specific Unicode sequences repeated to large scale will reliably trigger resource exhaustion. However, real-world exploitability is constrained by the fact that normal domain usage never involves such inputs. An attacker must either control the domain name input directly (e.g., via a web form, API parameter, or DNS query) or manipulate another user's input. The vulnerability is not in the CISA KEV catalog, indicating no active in-the-wild exploitation has been reported to date. The attack surface depends on application design: if the application enforces a 253-character limit or validates input before passing to idna, exploitability is eliminated.

Remediation

Upgrade the kjd/idna library to version 3.15 or later. This extends early input rejection to all code paths. For version 3.14, the fix is incomplete and applies only to the primary encode() function; if your application uses per-label functions or codec interfaces, upgrade to 3.15. If immediate upgrade is not feasible, implement a length check at the application layer: reject any domain input exceeding 253 characters before it reaches the idna library. This workaround is standards-compliant (DNS limits domains to 253 characters) and eliminates the vulnerability in practice. Verify dependencies: review all packages that import idna to ensure they are compatible with the upgraded version and that no pinned sub-dependencies force the use of older versions.

Patch guidance

Update idna to version 3.15 or later. Consult the kjd/idna GitHub repository and PyPI package page for the latest release notes and compatibility information. The fix involves rejecting arbitrarily long inputs early in the validation pipeline, before expensive Unicode processing occurs. When upgrading, test DNS resolution, email validation, and any domain-processing workflows to ensure compatibility. If your application uses custom IDNA functions or has integrated idna into a proprietary codebase, verify that the upgrade does not break any assumptions about error handling or validation timing. Minor version upgrades should be safe; pin to 3.15 or a later patch release (3.15.x) to receive security updates without major version bumps.

Detection guidance

Monitor application logs and metrics for sudden spikes in CPU usage or process hang events correlated with domain name input. Watch for repeated submission of very long domain names or suspicious Unicode character sequences in DNS queries, email headers, or domain input fields. Network-based detection is challenging without deep packet inspection, since the attack appears as a normal domain name query or API request; focus on application-layer signals. If you maintain DNS logs, look for queries containing Unicode escapes or sequences that are unusually long. Review dependency trees to identify which services import idna and audit their input validation. Test your applications by submitting a crafted payload (e.g., a domain name 10,000+ characters long containing repeated \u0660 sequences) to a non-production environment and observe resource consumption.

Why prioritize this

Prioritize patching based on exposure: services that accept user-supplied domain names or email addresses without length validation should upgrade immediately. Applications with IDNA libraries pinned to versions prior to 3.14 should be treated as higher priority. However, given the CVSS score of 5.3 (MEDIUM), the lack of KEV listing, and the requirement for either attacker-controlled input or no upstream validation, this is not a critical emergency. Balance this against your patch cycle: if your organization has a regular monthly or quarterly patching process, CVE-2026-45409 should be included in the next release cycle. High-risk exceptions: public DNS services, email validation APIs, and domain registration tools should prioritize faster patching.

Risk score, explained

The CVSS 3.1 score of 5.3 reflects the following factors: Network-accessible (AV:N), no authentication required (PR:N), low attack complexity (AC:L), no user interaction needed (UI:N), and impact limited to availability (A:L with C:N and I:N). The score is not elevated to HIGH because the attack surface is narrow (requires unvalidated input) and the impact is denial-of-service rather than privilege escalation or data breach. The vulnerability is real and exploitable under the right conditions, but the bar for triggering it is higher than a typical network-based RCE. In an organization without strict input validation, the risk is closer to the upper end of MEDIUM; in organizations with robust input sanitization, the risk is lower.

Frequently asked questions

Is this the same as CVE-2024-3651?

It is the same underlying vulnerability, but with an incomplete fix. CVE-2024-3651 was patched in 2024 in version 3.14, which added early length rejection to the primary encode() function. However, alternate code paths (per-label conversions and codec functions) were not fixed until version 3.15. If you patched to 3.14 and your application uses only idna.encode(), you are protected; if it uses codec or per-label APIs, upgrade to 3.15.

Do I need to patch if I validate domain length in my application?

Not urgently. If your application enforces a 253-character length limit before passing input to idna, you are protected by the workaround and do not face exploitation risk. However, you should still upgrade eventually as part of normal security hygiene to reduce attack surface and ensure compatibility with future library versions.

What Unicode sequences trigger this vulnerability?

The advisory mentions payloads like '\u0660' repeated N times (where N is large, e.g., 10,000+) or '\u30fb' repeated N times followed by '\u6f22'. The common thread is repeated Unicode characters that pass Unicode validation rules (valid_contexto) before being rejected as exceeding length limits. Other sequences may also trigger the issue; the safest approach is to upgrade and enforce length limits.

Will upgrading break my application?

Version 3.15 is a minor version bump and should be backward-compatible. The change is internal: the library rejects invalid input faster, which is not a breaking change for correctly-behaved applications. Test in a staging environment before production deployment to confirm compatibility with your specific use cases, particularly if you rely on IDNA codec interfaces.

This analysis is based on the official CVE-2026-45409 description and CVSS metrics as of the published date. Patch version numbers, vendor advisories, and specific affected products should be verified against the official kjd/idna GitHub repository and PyPI package page before implementation. No proof-of-concept exploit code is provided. Organizations should test patches in non-production environments and evaluate their specific risk based on whether their applications accept unvalidated domain input. This guidance is current as of the CVE publication date; refer to vendor advisories for the latest remediation and compatibility information. Source: NVD (public-domain), retrieved 2026-07-14. Analysis generated by SEC.co (claude-haiku-4-5).