CVE-2025-71408
NLTK < 3.9.3 Eval Injection via collocations.py Command-Line Arguments
Reported by vulncheck · Published July 24, 2026
nltk is fixed in 3.9.3 (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| nltk | PyPI | 3.9.3 |
| ntlk | ntlk | 3.9.3 |
| nltk | nltk | 3.9.3 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| ntlk | ntlk | 0 |
| PyPI | nltk | 0 |
| ntlk | ntlk | 0 |
Timeline
- Jul 24, 2026 CVE Published
- Jul 25, 2026 EPSS Score (16 in total, the first dated here)
- Jul 25, 2026 Coalition ESS Score
- Jul 27, 2026 Security Advisory
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2025-71408
vulnetix vdb fixes CVE-2025-71408
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-71408/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- Researcher Disclosure technical-descriptionexploit
- NLTK 3.9.3 Release Notes release-notespatch
- Pull Request issue-trackingpatch
- Patch Commit patch
- third-party-advisory
- https://nvd.nist.gov/vuln/detail/CVE-2025-71408 advisory
- https://github.com/advisories/GHSA-848c-c2cx-j7qx advisory
- https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval url
- https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3657.yaml advisory