High severity7.8NVD Advisory· Published Jul 24, 2026· Updated Aug 10, 2026
CVE-2025-71408
CVE-2025-71408
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
nltkPyPI | < 3.9.3 | 3.9.3 |
Affected products
2Patches
Vulnerability mechanics
References
9- github.com/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0acnvdPatchWEB
- github.com/nltk/nltk/pull/3465nvdIssue TrackingPatchWEB
- www.vulncheck.com/advisories/nltk-eval-injection-via-collocations-py-command-line-argumentsnvdPatchThird Party AdvisoryWEB
- aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/nvdExploitPress/Media CoverageThird Party Advisory
- github.com/advisories/GHSA-848c-c2cx-j7qxghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-71408ghsaADVISORY
- aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-evalghsaWEB
- github.com/nltk/nltk/releases/tag/3.9.3nvdRelease NotesWEB
- github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3657.yamlghsaWEB
News mentions
0No linked articles in our index yet.