CVE-2026-129226: NLTK: Uncontrolled recursion in semantic-logic type parser causes denial of service via nested type strings
Published 2026-11-19 · Updated 2026-11-20 · Also known as GHSA-w3pv-xfw4-ghr7
Summary
NLTK is vulnerable to a denial of service attack due to uncontrolled recursion in its semantic-logic type parser. Developers using NLTK to parse untrusted type strings or signatures should prioritize upgrading to the next official release once available.
Who is affected
Applications that accept untrusted input for type strings or signature parameters are susceptible to unhandled RecursionError exceptions. An attacker can trigger this by providing deeply nested type strings, causing the application worker or process to crash. Confidentiality and integrity remain unaffected as this is a limited denial-of-service vector.
Exploitability
The vulnerability is rated as Medium severity with a CVSS 3.1 score of 5.3, reflecting its low complexity and requirement for network-level access. It is not currently listed in CISA's Known Exploited Vulnerabilities catalog, and EPSS data is not yet available.
Remediation
- Upgrade to NLTK version 3.10.4 or later as soon as it is released.
- Monitor the NLTK repository for the official release containing commit e521ecafc.
- If an upgrade is not immediately possible, implement input validation to restrict the depth of type strings passed to NLTK's Type.fromstring or related semantic logic functions.
How to check your project
- Check the project's dependency manifest (e.g., requirements.txt, pyproject.toml) to determine if the installed version of nltk is less than 3.10.4.
- Verify the installed version via command line: pip show nltk.
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
Is remote code execution possible?
No. The vulnerability is limited to a Python RecursionError which terminates the execution thread or process, but does not allow for memory corruption or arbitrary code execution.
Are all NLTK users at risk?
No. Risk is limited to applications that process untrusted or attacker-controlled input within NLTK's semantic-logic parsing functions, such as Type.fromstring.
Has a fix been released yet?
The fix has been merged into the development branch (commit e521ecafc), but as of 2026-09-28, no official release version containing this fix is available.
Original advisory description
References
- WEB https://github.com/nltk/nltk/security/advisories/GHSA-w3pv-xfw4-ghr7
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-129226
- WEB https://github.com/nltk/nltk/pull/3885
- WEB https://github.com/nltk/nltk/commit/2f4f0d47e2c452c89cabc2a5f761332d51066ea8
- WEB https://github.com/nltk/nltk/commit/a8036c5e7f820ac09c96b969d6e7f19bfa6e6aeb
- PACKAGE https://github.com/nltk/nltk
- WEB https://github.com/nltk/nltk/releases/tag/v3.10.4
Source records: GHSA-w3pv-xfw4-ghr7 (OSV.dev) · EPSS by FIRST, 2026-11-23.