home / blog

2026-11-22 · medium

CVE-2026-129224: Infinite recursion vulnerability in NLTK

CVE-2026-129224: Vulnerability in NLTK causes RecursionError with excessively nested parenthesized categories.

CVE-2026-129224: Infinite recursion vulnerability in NLTK

CVE-2026-129224 concerns an infinite recursion vulnerability in the matchBrackets and augParseCategory functions of the CCG lexicon parser in NLTK (Natural Language Toolkit). These functions process nested parenthesized categories without a depth bound, allowing an attacker to cause RecursionError through nltk.ccg.lexicon.fromstring and terminate the parse operation or request worker.

The vulnerability has a CVSS of 5.3 classified as Medium. It was officially published on NVD on 19/11/2026. Signals on GitHub indicate the existence of public repositories that declare to contain exploit code for this vulnerability. The issue manifests with excessively nested parenthesized categories, where the vulnerable version 3.10.3 generates RecursionError at depth 3000 while the fixed version 3.10.4 limits to MAX_PARSE_DEPTH=500.

It is crucial to immediately update NLTK to version 3.10.4 or higher to mitigate the risk. Organizations using NLTK for natural language processing should verify their dependencies and apply patches. In case of inability to update, implement input validation to limit the depth of parsed parenthesized categories.

At a glance

What
Infinite recursion vulnerability in matchBrackets and augParseCategory functions of CCG lexicon parser in NLTK
Severity
Medium (CVSS 5.3)
Affected versions
NLTK 3.10.3 and earlier
Fix
Version 3.10.4 which introduces MAX_PARSE_DEPTH=500 limit
Status
Officially published on 19/11/2026
Action
Update to version 3.10.4 or later

Sources: NVD, CVE-2026-129224

← All articles