NLTK: Uncontrolled recursion in CCG lexicon parser causes denial of service via deeply nested category input
CVE-2026-129224
Root Cause The CCG lexicon parser recurses on nested parenthesised categories without any depth bound. matchBrackets (nltk/ccg/lexicon.py:154) calls itself once per nested (, and augParseCategory (nltk/ccg/lexicon.py:228,242) recurses once per bracketed sub-category. Neither function tracks recursion depth nor checks sys.getrecursionlimit(), and the public entry point fromstring (nltk/ccg/lexicon.py:252, also re-exported via nltk.ccg.chart.fromstring) applies no length or nesting cap before handing the text to the parser. Impact An application that parses an untrusted lexicon string aborts with an unhandled RecursionError, terminating the affected parse operation or request worker (denial of service, CWE-674). The recursion is pure Python, so CPython raises a catchable RecursionError rather than crashing the process; there is no memory-corruption or code-execution primitive. Confidentiality and integrity are unaffected. Plausibly, a service that does not wrap the parse in a handler will surface the error to the caller and drop the in-flight request. Attack Chain 1. The application calls nltk.ccg.lexicon.fromstring(lexstr) with attacker-supplied text such as ":- S\nw => " + "("…
Assessment
- CVSS
- 5.3 (v3.1)
- Severity
- Medium
- Known exploited
- Not listed in CISA KEV
- Exploit availability
- Nothing found in Exploit-DB, Metasploit, Nuclei or public PoC repositories
- Published
- 19 November 2026
- Last updated
- 19 November 2026
- Affected
- nltk
- Weakness
- CWE-674
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
At the source
References
- https://github.com/nltk/nltk/security/advisories/GHSA-3h95-x772-4765
- https://nvd.nist.gov/vuln/detail/CVE-2026-129224
- https://github.com/nltk/nltk/pull/3885
- https://github.com/nltk/nltk/commit/30e93eb7b69021293e019042fe0cedb99c95b054
- https://github.com/nltk/nltk/releases/tag/v3.10.4
- https://github.com/advisories/GHSA-3h95-x772-4765
Community proofs of concept
No community proof of concept yet. If you have one for a published vulnerability and the right to share it, add it below — it will appear here once reviewed.
Submit a proof of concept
Only for publicly disclosed vulnerabilities, and only material from testing you were authorised to perform. This platform does not buy, sell, or broker exploits — see earning from vulnerability research for legitimate bounty programs. Submissions are reviewed before they appear. Text only; do not include live credentials, personal data, or anything targeting systems you are not permitted to test.
Query this programmatically
Agents can read this through the MCP endpoint, or over HTTP:
curl https://cve.zerocrew.in/api/cve/CVE-2026-129224