NLTK fixes recursion flaw that could crash processes handling crafted files
- Natural Language Toolkit
- DependencyGraph
- RecursionError
- DoS
- dependency-parse

Flaw allowed crafted files to trigger process crashes
Update to version 3.10.4 to mitigate security risk
Natural Language Toolkit (NLTK) versions 3.10.3 and earlier contain a flaw in the DependencyGraph.tree() and DependencyGraph.triples() methods that can crash a process when it handles a crafted dependency-parse file. The project fixed the issue in version 3.10.4.
The affected methods process dependency structures with unbounded recursion and do not use cycle detection. A file containing several thousand chained tokens can trigger an unhandled RecursionError when either method runs.
An unauthenticated attacker who can submit such a file for processing could cause a denial of service. The flaw affects versions 3.10.3 and earlier; version 3.10.4 contains the patch.
Key terms explained
- Natural Language Toolkit
Natural Language Toolkit is a software platform used for developing Python programs that process human language data.
- denial-of-service
A denial-of-service attack is a malicious attempt to make a system or network resource unavailable to its intended users. This is often achieved by overwhelming the target with excessive traffic or requests.
Think of it this way. This is like a crowd of people blocking the entrance to a store so that actual customers cannot get inside to shop.




