CVE-2025-71408
HIGH 8.5CVSS 4.0NLTK vulnerable to Eval Injection via collocations CLI arguments
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.
- Published
- 24 Jul 2026
- Last modified
- 8 Oct 2026
- Assigned by
- disclosure@vulncheck.com
- NVD status
- Analyzed
- Weakness
- CWE-95
- Also known as
- GHSA-848c-c2cx-j7qxPYSEC-2026-3657
- Sources
- NVDJSONOSV GHSA-848c-c2cx-j7qxJSONOSV PYSEC-2026-3657JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | disclosure@vulncheck.com (Secondary) | CVSS 4.0 | HIGH 8.5 | CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N | |
| OSV | PyPA | CVSS 4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X | |
| NVD | disclosure@vulncheck.com (Secondary) | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | nltk | nltkcpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:* |
< 3.9.3 | 3.9.3 |
| OSV | PyPI | nltk | < 3.9.3 | 3.9.3 |
References
- https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/ · Exploit, Press/Media Coverage, Third Party Advisory, WEB, EVIDENCE
- https://github.com/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0ac · Patch, WEB, FIX
- https://github.com/nltk/nltk/pull/3465 · Issue Tracking, Patch, WEB, FIX
- https://github.com/nltk/nltk/releases/tag/3.9.3 · Release Notes, WEB, ADVISORY
- https://www.vulncheck.com/advisories/nltk-eval-injection-via-collocations-py-command-line-arguments · Patch, Third Party Advisory, WEB, FIX
- https://nvd.nist.gov/vuln/detail/CVE-2025-71408 · ADVISORY
- https://github.com/nltk/nltk · PACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3657.yaml · WEB
- https://github.com/advisories/GHSA-848c-c2cx-j7qx · ADVISORY
History
- 25 Nov 2026 21:04 UTC · NVD: first stored (published 24 Jul 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 24 Jul 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 25 Jul 2026)