CVE-2025-71408
Published:July 24, 2026
Updated:August 06, 2026
NLTK (Natural Language Toolkit) before version 3.9.3 contains an eval injection vulnerability in the nltk.collocations module that allows an attacker who controls command-line arguments to execute arbitrary Python code. When collocations.py is invoked directly, the main block passes command-line arguments directly to eval() as suffixes of BigramAssocMeasures without allowlist validation or sanitization, enabling an attacker to supply a Python expression that escapes the intended attribute lookup and executes arbitrary code including OS commands via the os module.
Affected Packages
nltk (CONDA):
Affected version(s) >=2.0.3 <3.9.3Fix Suggestion:
Update to version 3.9.3https://github.com/nltk/nltk.git (GITHUB):
Affected version(s) >=2.0.3 <3.9.3Fix Suggestion:
Update to version 3.9.3nltk (PYTHON):
Affected version(s) >=0.8 <3.9.3Fix Suggestion:
Update to version 3.9.3Additional Notes
The description of this vulnerability differs from MITRE.
Related Resources (8)
Do you need more information?
Contact UsCVSS v4
Base Score:
8.5
Attack Vector
LOCAL
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
LOW
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
HIGH
Vulnerable System Availability
HIGH
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
7.8
Attack Vector
LOCAL
Attack Complexity
LOW
Privileges Required
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Weakness Type (CWE)
Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')
EPSS
Base Score:
0.16