CVE-2025-71408: Safety · NLTK vulnerable to Eval Injection via collocations CLI arguments
Affects safetySource GCVE Database
Not known to be exploited · CVSS 7.8 High : upgrade to 3.7.0_5 soon.
Data as of 30 Oct 2026, 07:30 UTC
- Patch
- Available – fixed in 3.7.0_5
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 13 Aug 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.
What to do
Upgrade safety to 3.7.0_5.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Homebrewsafetypkg:brew/safetyOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
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.
References
- nvd.nist.gov/vuln/detail/CVE-2025-71408 (opens in a new tab)
- github.com/nltk/nltk/pull/3465 (opens in a new tab)
- github.com/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0ac (opens in a new tab)
- aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval (opens in a new tab)
- github.com/nltk/nltk (opens in a new tab)
- github.com/nltk/nltk/releases/tag/3.9.3 (opens in a new tab)
- github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3657.yaml (opens in a new tab)
- vulncheck.com/advisories/nltk-eval-injection-via-collocations-py-command-line-arguments (opens in a new tab)