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.
Severity
HIGH
CVSS v3
7.8
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H · source cna
CVSS v4
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 · source cna
Exploit chance (EPSS)
0.265%
chance of exploitation in the next 30 days
higher than 18.6% of scored CVEs · 2026-11-17
CISA KEV
Not listed
Public exploit code
Yes
Exploit references (NVD and CNA): 1
Metasploit modules: 0
Nuclei templates: 0
Weakness
- CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code
CISA SSVC decision points
| Exploitation | poc |
|---|---|
| Automatable | no |
| Technical impact | total |
| Scored | 2026-07-27 |
Timeline
- 2026-07-24Published by the CNA21:07 UTC
- 2026-07-25GitHub advisory published (GHSA-848c-c2cx-j7qx)1 day after publication
- 2026-07-27CISA SSVC decision recorded3 days after publication
Exploit and advisory records
GitHub advisory GHSA-848c-c2cx-j7qx, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| PyPI nltk | before 3.9.3 | 3.9.3 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| nltk nltk | before 3.9.3fixed in 3.9.3 | 3.9.3 |
References
- https://github.com/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0ac
- https://github.com/nltk/nltk/pull/3465
- https://github.com/nltk/nltk/releases/tag/3.9.3
- https://www.vulncheck.com/advisories/nltk-eval-injection-via-collocations-py-command-line-arguments
- https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2025-71408'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2025-71408'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2025-71408'curl 'https://api.contrastcyber.com/cve_products/CVE-2025-71408'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).