CVE-2026-129224: NLTK: Uncontrolled recursion in CCG lexicon parser causes denial of service via deeply nested category input
Published 2026-11-19 · Updated 2026-11-20 · Also known as GHSA-3h95-x772-4765
Summary
The NLTK library's CCG lexicon parser suffers from uncontrolled recursion when processing deeply nested category strings. Developers using NLTK to parse untrusted input should update to version 3.10.4 or implement input length constraints.
Who is affected
Applications that pass user-supplied strings to 'nltk.ccg.lexicon.fromstring' are vulnerable to a denial-of-service attack. An attacker can trigger an unhandled 'RecursionError' by providing a payload with sufficient nesting, which terminates the affected request worker.
Exploitability
The vulnerability is categorized as Medium severity with a CVSS 3.1 base score of 5.3, indicating low complexity for an unauthenticated remote attacker. EPSS data is not available and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade the nltk package to version 3.10.4 or later once available in your package manager.
- If immediate upgrading is not possible, wrap calls to 'nltk.ccg.lexicon.fromstring' in a try-except block to catch 'RecursionError'.
- Implement strict input length and nesting validation on all lexicon strings before passing them to the NLTK parser.
How to check your project
- Check the project's 'requirements.txt', 'poetry.lock', or 'Pipfile.lock' to see if 'nltk' is below version 3.10.4.
- Run 'pip show nltk' in the target environment to verify the currently installed version.
- Use static analysis tools to identify calls to 'nltk.ccg.lexicon.fromstring' or 'nltk.ccg.chart.fromstring' that accept unsanitized user input.
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
Does this vulnerability allow for remote code execution?
No. The issue is a pure Python 'RecursionError' resulting in a denial-of-service, with no memory corruption or code execution primitives identified.
Is this vulnerability currently being exploited in the wild?
No. There is no evidence of active exploitation, and the vulnerability is not listed on the CISA Known Exploited Vulnerabilities (KEV) list.
Is there a fixed version available?
The fix is merged into the develop branch (commit 30e93eb7b) and is targeted for release in version 3.10.4.
Original advisory description
References
- WEB https://github.com/nltk/nltk/security/advisories/GHSA-3h95-x772-4765
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-129224
- WEB https://github.com/nltk/nltk/pull/3885
- WEB https://github.com/nltk/nltk/commit/30e93eb7b69021293e019042fe0cedb99c95b054
- PACKAGE https://github.com/nltk/nltk
- WEB https://github.com/nltk/nltk/releases/tag/v3.10.4
Source records: GHSA-3h95-x772-4765 (OSV.dev) · EPSS by FIRST, 2026-11-21.