CVE-2026-129227: NLTK: Uncontrolled recursion in Tree.fromlist causes denial of service via deeply nested list input
Published 2026-11-19 · Updated 2026-11-20 · Also known as GHSA-63wh-5r5m-wxr7
Summary
An uncontrolled recursion vulnerability exists in NLTK's Tree.fromlist due to a missing depth bound on nested list inputs. Engineering teams using NLTK to parse untrusted list data should update their dependencies.
Who is affected
Applications that construct NLTK Tree objects from attacker-controlled nested lists-such as parsed JSON payloads-are vulnerable to unhandled RecursionErrors. This causes the affected operation or request worker to crash, resulting in a denial of service. Confidentiality and integrity remain unaffected.
Exploitability
The vulnerability is assigned a MEDIUM severity with a CVSS 3.1 base score of 5.3, utilizing the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L. EPSS data is not yet available, and CISA Known Exploited Vulnerabilities indicates no active exploitation.
Remediation
- Upgrade the PyPI package nltk to version 3.10.4 or higher.
- Ensure applications do not pass untrusted or deeply nested lists to Tree.fromlist without prior depth validation if using an older version.
How to check your project
- Check dependency management files (such as requirements.txt, pyproject.toml, or poetry.lock) to see if nltk is pinned to a version below 3.10.4.
- Inspect application codebase for calls to nltk.tree.Tree.fromlist processing external or untrusted inputs.
Automated analysis of the published advisory data, generated 2026-11-20. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| PyPI | nltk |
>= 0, < 3.10.4 | 3.10.4 | python -m pip install 'nltk>=3.10.4' |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Privileges required | None |
| User interaction | None |
| Scope | Unchanged |
| Confidentiality | None |
| Integrity | None |
| Availability | Low |
FAQ
What causes CVE-2026-129227?
The vulnerability is caused by Tree.fromlist recursing once per nesting level without a depth bound, while its sibling constructor Tree.fromstring is properly protected by a MAX_TREE_DEPTH cap.
What is the security impact?
An attacker can supply a deeply nested list to trigger an unhandled RecursionError, terminating the worker process and causing a denial of service.
What is the fixed version for nltk?
The issue is fixed in nltk version 3.10.4.
Original advisory description
References
- WEB https://github.com/nltk/nltk/security/advisories/GHSA-63wh-5r5m-wxr7
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-129227
- WEB https://github.com/nltk/nltk/pull/3885
- WEB https://github.com/nltk/nltk/commit/ae4c5c900a81608026a43bd4ed17ff048c447c8c
- PACKAGE https://github.com/nltk/nltk
- WEB https://github.com/nltk/nltk/releases/tag/v3.10.4
Source records: GHSA-63wh-5r5m-wxr7 (OSV.dev) · EPSS by FIRST, 2026-11-23.