CVE-2025-71408 json
NLTK < 3.9.3 Eval Injection via collocations.py Command-Line Arguments
published 2026-07-24 3 mo ago modified 2026-10-08 31 d ago also GHSA-848c-c2cx-j7qx , PYSEC-2026-3657 , EUVD-2025-210509
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 18%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2025-71408 updated cvss 7.0
nltk: NLTK: Arbitrary Code Execution via Eval Injection in Collocations Module
-
Red Hat Exploit Intelligence exploit-intelligence-tech-preview/vulnerability-analysis-rhel9 Red Hat Ansible Automation Platform 2 ansible-automation-platform-25/lightspeed-chatbot-rhel8affected: workaround, no fix planned “Will not fix”
-
Red Hat OpenShift AI (RHOAI) rhoai/odh-ta-lmes-job-rhel9affected: workaround, no fix available
-
Red Hat OpenShift AI 3.3 rhoai/odh-llama-stack-core-rhel9 1789121286fixed: vendor fix RHSA-2026:73987
-
Red Hat Lightspeed Core lightspeed-core/rag-tool-cpu-rhel9, lightspeed-core/lightspeed-stack-rhel9, lightspeed-core/rag-tool-cuda-12.9-rhel9 Red Hat OpenShift Lightspeed openshift-lightspeed/lightspeed-ocp-rag-rhel9, openshift-lightspeed/lightspeed-service-api-rhel9, openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9 Red Hat OpenShift AI (RHOAI) rhoai/odh-ogx-core-rhel9, rhoai/odh-trustyai-garak-lls-provider-dsp-rhel9, rhoai/odh-trustyai-nemo-guardrails-server-rhel9, rhoai/odh-pipeline-runtime-pytorch-llmcompressor-cuda-py312-rhel9, rhoai/odh-workbench-jupyter-pytorch-llmcompressor-cuda-py312-rhel9 Red Hat OpenShift AI 3.3 rhoai/odh-cli-rhel9 1790070206, rhoai/rhai-cli-rhel9 1790070206, rhoai/odh-mlflow-rhel9 1789653606, rhoai/odh-trainer-rhel9 1790136369, rhoai/odh-maas-api-rhel9 1790131842, rhoai/odh-mlserver-rhel9 1789121365, +76 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- total
- Assessed
- 3 mo ago
Exploit prediction
0.27% chance of exploitation in the next 30 days, higher than 18% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- aydinnyunus.github.io https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/ referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 4.0 | 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 |
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CNA | 4.0 | 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| GitHub | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | nltk | <3.9.3 |
3.9.3 |
Affected products
- ntlk ntlk
Classification
- Weakness
-
- CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code
References
-
github.com
/nltk/nltk/releases/tag/3.9.3
release-notes, patch, web, advisory
-
github.com
/nltk/nltk/pull/3465
issue-tracking, patch, web
-
github.com
/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0ac
patch, web
-
vulncheck.com
/advisories/nltk-eval-injection-via-collocations-py-command-line-arguments
third-party-advisory, web, patch
-
aydinnyunus.github.io
/2026/06/07/command-injection-nltk-collocations-eval/
technical-description, exploit, press/media-coverage, third-party-advisory, evidence
-
nvd.nist.gov
/vuln/detail/CVE-2025-71408
advisory
-
aydinnyunus.github.io
/2026/06/07/command-injection-nltk-collocations-eval
web
-
github.com
/nltk/nltk
package
-
github.com
/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3657.yaml
web
-
github.com
/advisories/GHSA-848c-c2cx-j7qx
advisory
Sources
- CVE List CVE-2025-71408
- GitHub Advisory GHSA-848c-c2cx-j7qx
- NVD CVE-2025-71408
- OSV PYSEC-2026-3657
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.