CVE-2025-71408
highpriority · track · 0EPSS 0.003 · 18 %ileEURUUSEPSS · scored 2026-10-28
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 5.9–8.5
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (4)
Products and version ranges known to be affected.
advisories (2)
Vendor and ecosystem advisories describing this.
- GHSA-848c-c2cx-j7qxNLTK vulnerable to Eval Injection via collocations CLI arguments2026-07-25ghsa · osvUS
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.
- PYSEC-2026-36572026-07-24vendor · osvUS
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.
also known as (7)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (16)
External citations — patches, advisories, analysis.
- https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/cnnvd
- https://github.com/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0accnnvd
- https://github.com/nltk/nltk/pull/3465cnnvd
- https://github.com/nltk/nltk/releasesPatchcnnvd
- https://github.com/nltk/nltk/releases/tag/3.9.3cnnvd
- https://www.vulncheck.com/advisories/nltk-eval-injection-via-collocations-py-command-line-argumentscnnvd
- https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/enisa_euvd
- https://github.com/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0acenisa_euvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan