CVE-2026-126299
High 7.5No known exploitationFix availableNLTK before 3.10.4 Quadratic-Time Denial of Service via CCG Lexicon fromstring
Vendor advisory: GHSA-89p3-fcch-88ph
Record last updated
CVSS score
High on a 0 to 10 scale
EPSS, chance of exploitation in 30 days
Higher than 48% of scored CVEs. A prediction, not evidence.
CISA remediation deadline
Not in the KEV catalog
Description
## Summary The public CCG lexicon parser `nltk.ccg.lexicon.fromstring` parses caller-influenced lexicon text with two pure-Python loops whose cost is quadratic in the input width. A service that parses an untrusted CCG lexicon string can be driven into tens of seconds of single-threaded CPU by a few-megabyte input, starving the request worker. No authentication or user interaction is required. ## Root Cause `matchBrackets` consumes a bracket body one character at a time with `inside = inside + rest[0]; rest = rest[1:]`. The `rest = rest[1:]` tail re-slice copies the entire remaining string on every iteration, so a flat bracket body costs O(n^2). `augParseCategory` drives a `while rest != "":` operator loop that re-copies the regular-expression match tail (`rest = app[3]`) once per operator, which is also O(n^2) over a long operator chain. The parser carries a recursion-depth guard (`MAX_PARSE_DEPTH = 500`) that raises on deeply nested categories, but both quadratic loops run on flat input whose nesting depth stays at zero, so that guard never fires. No bound is applied to line length or category width before the text reaches these loops. ```text Affected functions: - nltk.ccg.lexi…
Weakness: CWE-400, CWE-407
Patching and mitigation
- Patch status
- Fix available (source: Microsoft MSRC)
- Fix documented (source date)
- Mitigation
- None documented
- Vendor guidance
- msrc.microsoft.com (opens in a new tab)
Affected products
| Vendor | Product | Affected versions | Fixed in | Per |
|---|---|---|---|---|
| Microsoft | azl4 python-nltk 1:3.9.1-9.azl4 on Azure Linux 4.0 | Not documented | Not documented | Microsoft MSRC |
| pip | nltk | all versions up to and including 3.10.3 | 3.10.4 | GitHub Advisory Database |
Timeline
Advisory
Microsoft advisory published
Advisory change
Microsoft advisory revised (2.0): Information published.
Patch
Fix documented by Microsoft MSRC
Vendor guidance and references
- Microsoft Security Update Guide (opens in a new tab)vendor-advisory
- GitHub Advisory GHSA-89p3-fcch-88ph (opens in a new tab)github-advisory