CVE-2026-126299 in NLTKinfo

Summary

by MITRE • 11/13/2026

NLTK before 3.10.4 contains a denial of service vulnerability in the CCG lexicon parser fromstring that allows remote attackers to exhaust CPU by supplying wide inputs. Attackers can submit lexicon text with long flat bracket bodies or operator chains, triggering quadratic string re-slicing in matchBrackets and augParseCategory that blocks worker threads.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/13/2026

The Natural Language Toolkit (NLTK) is a widely used Python library for symbolic and statistical natural language processing, offering easy-to-use interfaces to over fifty corpora and lexical resources such as WordNet. Within this ecosystem, the Context-Free Grammar parser includes functionality for parsing Combinatory Categorial Grammar lexicons through the fromstring method. A critical vulnerability exists in versions of NLTK prior to 3.10.4 that affects the CCG lexicon parser. This flaw allows remote attackers to cause a denial of service by supplying specifically crafted wide inputs designed to exhaust system CPU resources. The core technical issue stems from an algorithmic inefficiency where long flat bracket bodies or extensive operator chains trigger quadratic string re-slicing operations within the matchBrackets and augParseCategory functions.

When an attacker submits lexicon text containing deeply nested structures or excessively long sequences of operators, the parser attempts to resolve these constructs by repeatedly slicing strings during the matching process. This behavior results in a time complexity that scales quadratically with the size of the input rather than linearly. As the length of the malicious input increases, the computational effort required grows exponentially, leading to significant CPU consumption. In environments where NLTK is deployed as part of a web service or an automated processing pipeline, this resource exhaustion can block worker threads effectively halting other legitimate operations and rendering the application unresponsive to genuine users.

This vulnerability aligns with CWE-400, which describes Uncontrolled Resource Consumption, specifically manifesting through excessive CPU usage due to inefficient algorithmic handling of input data. From a threat intelligence perspective, this attack vector is consistent with ATT&CK technique T1496, Host Denial of Service, where an adversary disrupts the availability of a host by consuming its resources. The exploitation does not require authentication if the lexicon parsing functionality is exposed via a network service or API endpoint that accepts user-supplied grammar definitions without sufficient length constraints or complexity limits.

To mitigate this risk, organizations utilizing NLTK must upgrade to version 3.10.4 or later, where these algorithmic inefficiencies have been addressed. For systems that cannot be immediately patched, implementing input validation is crucial. This includes enforcing strict maximum lengths on lexicon inputs and limiting the depth of nested brackets or operator chains accepted by the parser. Additionally, deploying resource monitoring tools to detect abnormal CPU spikes associated with parsing tasks can help identify potential exploitation attempts in real-time. Applying rate limiting to endpoints that accept grammar definitions further reduces the window of opportunity for attackers to execute sustained denial-of-service attacks against vulnerable instances.

Responsible

VulnCheck

Reservation

11/10/2026

Disclosure

11/13/2026

Moderation

accepted

CPE

ready

EPSS

0.00576

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!