{"id":"CVE-2025-71408","published":"2026-07-24T21:07:49Z","modified":"2026-10-08T15:21:35Z","title":"NLTK < 3.9.3 Eval Injection via collocations.py Command-Line Arguments","vendor":"ntlk","product":"ntlk","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00265,"percentile":0.1881,"provenance":"source"},"cwes":[{"id":"CWE-95","name":"Improper Neutralization of Directives in Dynamically Evaluated Code"}],"references":[{"url":"https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/","tags":["technical-description","exploit"]},{"url":"https://github.com/nltk/nltk/releases/tag/3.9.3","tags":["release-notes","patch"]},{"url":"https://github.com/nltk/nltk/pull/3465","tags":["issue-tracking","patch"]},{"url":"https://github.com/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0ac","tags":["patch"]},{"url":"https://www.vulncheck.com/advisories/nltk-eval-injection-via-collocations-py-command-line-arguments","tags":["third-party-advisory"]}],"priority":{"score":14.2,"factors":[{"name":"EPSS percentile","points":3.76},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.46}]},"vendorSlug":"ntlk","affectedVersions":[{"vendor":"ntlk","product":"ntlk","versions":["< 3.9.3"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2026-07-27T17:22:32.579274Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"nltk","vulnerableRanges":["<3.9.3"],"patched":["3.9.3"],"from":["GHSA-848c-c2cx-j7qx","PYSEC-2026-3657"],"provenance":"source"}],"summary":{"text":"The NLTK nltk.collocations module, in versions before 3.9.3, contains an eval injection flaw in its command-line entry point: when collocations.py is run directly, its __main__ block passes the supplied arguments to eval() as suffixes of BigramAssocMeasures without any validation. An attacker who can control those command-line arguments, with local access and low privileges, could supply a Python expression that breaks out of the intended attribute lookup to run arbitrary code, including OS commands via the os module, and no user interaction is required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:34:37Z"},"euvd":{"id":"EUVD-2025-210509","exploited":false,"provenance":"source"},"exploitRefs":["https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/"]}