NLTK flaw in Tree.fromlist can cause denial of service
- NLTK
- RecursionError
- denial of service

Flaw allowed denial of service via deeply nested list inputs
Vulnerability tracked as
CWE-674affects versions3.10.3and earlierNLTK versions through
3.10.3are affected;3.10.4is listed as patched
A GitHub advisory reports that uncontrolled recursion in NLTK’s Tree.fromlist method can cause a denial of service when it processes deeply nested lists. The vulnerability affects NLTK versions up to and including 3.10.3; the advisory lists 3.10.4 as the patched version.
An unhandled RecursionError can terminate the affected operation or request worker. The same error can occur during later recursive operations on an over-deep tree, including calculating its height, formatting it or comparing it for equality.
The advisory identifies the issue as CWE-674. It says the error is catchable and does not affect application confidentiality or integrity.
Key terms explained
- denial of service
A denial of service is a condition where authorized users cannot access system resources. This often happens when a system is overwhelmed by traffic or requests, causing it to crash or become unresponsive.
Think of it this way. It is like a single person blocking the entrance to a store so that no other customers can get inside to shop.
- CWE-674
CWE-674 refers to a weakness where a program fails to limit the depth of its recursive operations. This can lead to the exhaustion of system resources like memory or the stack, potentially causing a crash.
- NLTK
NLTK is an open-source library used for processing and analyzing human language data with Python. It provides various tools for tasks such as tokenization, parsing, and semantic reasoning.




