{"id":"CVE-2025-71408","title":"nltk: NLTK: Arbitrary Code Execution via Eval Injection in Collocations Module (CVE-2025-71408)","summary":"A flaw was found in NLTK (Natural Language Toolkit). This eval injection vulnerability in the `nltk.collocations` module allows a local attacker to execute arbitrary Python code. By manipulating command-line arguments when `collocations.py…","severity":"high","cvss":7,"cvssVector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","cvssSource":"vendor","cwe":"CWE-94","vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","affected":["exploit_intelligence","ansible_automation_platform 2","openshift_ai_rhoai"],"patched":["nltk 3.9.3"],"published":"2026-07-24","updated":"2026-09-15","sourceUpdated":"2026-09-15T14:12:00+00:00","source":"CSAF","sourceUrl":"https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-71408.json","references":[{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-71408.json"},{"url":"https://access.redhat.com/security/cve/CVE-2025-71408"},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2506944"},{"url":"https://www.cve.org/CVERecord?id=CVE-2025-71408"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71408"},{"url":"https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/"},{"url":"https://github.com/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0ac"},{"url":"https://github.com/nltk/nltk/pull/3465"},{"url":"https://github.com/nltk/nltk/releases/tag/3.9.3"},{"url":"https://www.vulncheck.com/advisories/nltk-eval-injection-via-collocations-py-command-line-arguments"}],"tags":["csaf","vex","red-hat","osv","pip"],"epss":0.00198,"epssPercentile":0.09918,"aliases":["PYSEC-2026-3657"],"ecosystem":"pip","ingestedAt":"2026-08-11T19:17:09.710Z","slug":"CVE-2025-71408","body":"## Overview\n\nA flaw was found in NLTK (Natural Language Toolkit). This eval injection vulnerability in the `nltk.collocations` module allows a local attacker to execute arbitrary Python code. By manipulating command-line arguments when `collocations.py` is invoked directly, an attacker can bypass validation and execute operating system commands. This can lead to significant impact on the system's confidentiality, integrity, and availability.\n\n## Vendor advisories\n\n- **Red Hat VEX** · Important · affected: Exploit Intelligence, Red Hat Ansible Automation Platform 2, Red Hat OpenShift AI (RHOAI) · no fix planned: Exploit Intelligence, Red Hat Ansible Automation Platform 2, Red Hat OpenShift AI (RHOAI) · updated 2026-09-15 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-71408.json)\n\n**nltk: NLTK: Arbitrary Code Execution via Eval Injection in Collocations Module** — rated Important by Red Hat. Released 2025-01-01, updated 2026-09-15.\n\nAffected:\n\n- Exploit Intelligence\n- Red Hat Ansible Automation Platform 2\n- Red Hat OpenShift AI (RHOAI)\n\nNo fix planned:\n\n- Exploit Intelligence\n- Red Hat Ansible Automation Platform 2\n- Red Hat OpenShift AI (RHOAI)\n\nNot affected:\n\n- Lightspeed Core\n- OpenShift Lightspeed\n- Red Hat OpenShift AI (RHOAI)\n\n## Remediation\n\nWill not fix\n\nWorkarounds / mitigations:\n\n- To mitigate this vulnerability, avoid directly invoking the `nltk.collocations` module's internal script (`collocations.py`) with untrusted command-line arguments. In standard Red Hat deployments, NLTK is typically used as an imported library, which does not expose this vulnerability. If direct invocation is necessary, ensure that all command-line arguments are from trusted sources and are properly validated.\n\n## Package advisory (CVE-2025-71408)\n\nAffected packages:\n\n- `nltk < 3.9.3`\n\nPatched in:\n\n- `nltk 3.9.3`\n\nSource: https://osv.dev/vulnerability/PYSEC-2026-3657","depth":"twilight","depthScore":39,"depthScoreParts":{"impact":38.5,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[{"seq":4915,"id":"CVE-2025-71408","ts":1788887215940,"field":"cvss","old":null,"new":"7"},{"seq":4914,"id":"CVE-2025-71408","ts":1788887215940,"field":"severity","old":"none","new":"high"},{"seq":3798,"id":"CVE-2025-71408","ts":1788886335327,"field":"cvss","old":"7","new":null},{"seq":3797,"id":"CVE-2025-71408","ts":1788886335327,"field":"severity","old":"high","new":"none"},{"seq":3223,"id":"CVE-2025-71408","ts":1788883134648,"field":"cvss","old":null,"new":"7"},{"seq":3222,"id":"CVE-2025-71408","ts":1788883134648,"field":"severity","old":"none","new":"high"}]}