Vulnerability · Published Jul 24, 2026 · Assigned by VulnCheck
CVE-2025-71408NLTK < 3.9.3 Eval Injection via collocations.py Command-Line Arguments
High 7.8
In plain English
A high-severity security flaw in ntlk from ntlk. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 19% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | nltk | no fix listed | DEBIAN-CVE-2025-71408 |
| Debian:13 | nltk | no fix listed | DEBIAN-CVE-2025-71408 |
| Debian:14 | nltk | 3.9.3-1 | DEBIAN-CVE-2025-71408 |
| PyPI | nltk | 3.9.3 | GHSA-848c-c2cx-j7qx |
| PyPI | nltk | 3.9.3 | PYSEC-2026-3657 |
Affected products (as reported)
Weakness: CWE-95 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
References
- Researcher Disclosure technical-description, exploit
- NLTK 3.9.3 Release Notes release-notes, patch
- Pull Request issue-tracking, patch
- Patch Commit patch
- https://www.vulncheck.com/advisories/nltk-eval-injection-via-collocations-py-command-line-arguments third-party-advisory