6.2medium
Denial of Service via Quadratic Complexity in kjd/idna
- Severity
- 6.2medium CVSS:3.0 by @huntr_ai
- Exploit likelihood
- 1.39% (higher than 73% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- @huntr_ai
- Also known as
- GHSA-jjg7-2v4v-x38hPYSEC-2024-60
Description
A vulnerability was identified in the kjd/idna library, specifically within the `idna.encode()` function, affecting version 3.6. The issue arises from the function's handling of crafted input strings, which can lead to quadratic complexity and consequently, a denial of service condition. This vulnerability is triggered by a crafted input that causes the `idna.encode()` function to process the input with considerable computational load, significantly increasing the processing time in a quadratic manner relative to the input size.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| kjd kjd/idna | from unspecified before 3.7 | CVE List |
| idna (PyPI) | before 3.7, before 1d365e17e10d72d0b7876316fc7b9ca0eebdd38d, from 0.1 before 3.7 | GitHub Advisory Database, PyPA Advisory Database |
| kjd internationalized_domain_names_in_applications | from 0.2 before 3.7 | NVD |
All scores
| @huntr_ai | 6.2medium CVSS:3.0 | CVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 6.2medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
What each source says
CVE List
A vulnerability was identified in the kjd/idna library, specifically within the `idna.encode()` function, affecting version 3.6. The issue arises from the function's handling of crafted input strings, which can lead to quadratic complexity and consequently, a denial of service condition. This vulnerability is triggered by a crafted input that causes the `idna.encode()` function to process the input with considerable computational load, significantly increasing the processing time in a quadratic manner relative to the input size.
GitHub Advisory Database
Impact
A specially crafted argument to the idna.encode() function could consume significant resources. This may lead to a denial-of-service.
Patches
The function has been refined to reject such strings without the associated resource consumption in version 3.7.
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.
References
NVD (es)
Se identificó una vulnerabilidad en la librería kjd/idna, específicamente dentro de la función `idna.encode()`, afectando a la versión 3.6. El problema surge del manejo por parte de la función de cadenas de entrada manipuladas, lo que puede generar complejidad cuadrática y, en consecuencia, una condición de denegación de servicio. Esta vulnerabilidad se activa por una entrada manipulada que hace que la función `idna.encode()` procese la entrada con una carga computacional considerable, aumentando significativamente el tiempo de procesamiento de manera cuadrática en relación con el tamaño de la entrada.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-3651 changed 2025-11-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jjg7-2v4v-x38h changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2024-3651 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2024-60 changed 2026-06-10 | CC-BY-4.0 |