CVE-2024-3651
JSON

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 packageVersionsReported by
kjd kjd/idnafrom unspecified before 3.7CVE List
idna (PyPI)before 3.7, before 1d365e17e10d72d0b7876316fc7b9ca0eebdd38d, from 0.1 before 3.7GitHub Advisory Database, PyPA Advisory Database
kjd internationalized_domain_names_in_applicationsfrom 0.2 before 3.7NVD

All scores

@huntr_ai6.2medium CVSS:3.0CVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub6.2medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHubmedium CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
PyPA Advisory Database7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-400CWE-1333

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

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

https://huntr.com/bounties/93d78d07-d791-4b39-a845-cbfabc44aadbevidence, exploit, fix, patch, web
https://github.com/kjd/idna/commit/1d365e17e10d72d0b7876316fc7b9ca0eebdd38dfix, patch, web
https://lists.debian.org/debian-lts-announce/2024/05/msg00006.htmlweb
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/F2S5E23N6E52S46KGNYTDFB75LOC4N4D/
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S5IDLLD2IKSIVRBSLB34WTSYGLMWUFWF/
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ULSC7HBJKXB3BZV367WM5BR6DFEC4Z43/
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4YQUPYH3SVZ5GFF2CDQ55FCM575AZTF2/
https://github.com/kjd/idna/security/advisories/GHSA-jjg7-2v4v-x38hweb
https://nvd.nist.gov/vuln/detail/CVE-2024-3651advisory
https://github.com/kjd/idnapackage
https://github.com/pypa/advisory-database/tree/main/vulns/idna/PYSEC-2024-60.yamlweb
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4YQUPYH3SVZ5GFF2CDQ55FCM575AZTF2web

Sources

SourceRecordLicence
CVE ListCVE-2024-3651 changed 2025-11-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-jjg7-2v4v-x38h changed 2026-09-10CC-BY-4.0
NVDCVE-2024-3651 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2024-60 changed 2026-06-10CC-BY-4.0