Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍 PyPI
Not in CISA KEV

CVE-2025-71408 — nltk

Fix: nltk/nltk@66f1409

CVE-2025-71408 is a CWE-95 vulnerability in nltk. A fix is available for nltk — see the affected versions and patch details below.

NLTK < 3.9.3 Eval Injection via collocations.py Command-Line Arguments

Also known asGHSA-848c-c2cx-j7qxPYSEC-2026-3657
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Oct 22, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA’s SSVC triage for CVE-2025-71408.

EPSS Exploitation Probability

via FIRST.org ↗
0.3%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs17th percentile — riskier than 17% of all scored CVEsHighest risk
0.00%0.26%0.51%0.77%0.2%0.2%0.3%0.3%Aug 26Oct 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

Real-World Exposure

1 pkg affected
🐍nltk

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

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.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPInltkall versions3.9.3pip install --upgrade 'nltk==3.9.3'

Affected Products

1 product · 1 configurations
Application
nltknltk
< 3.9.3
range

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for nltk, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update nltk to 3.9.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2025-71408 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatImportant

Conditions for Exploitation: Successful exploitation requires a highly specific and atypical execution scenario. An attacker must have direct control over command-line arguments, and the host environment must execute the module's internal script directly rather than importing NLTK as a standard programming library.…

Workaround published by Red Hat
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.
Source: Red Hat security advisory for CVE-2025-71408 (CC BY 4.0)
ProductFixed inAdvisory
Red Hat OpenShift AI 3.3rhoai/odh-llama-stack-core-rhel9:1789121286RHSA-2026:73987

Frequently Asked Questions

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.
O3 Security · Impact-Aware SCA

Is CVE-2025-71408 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2025-71408: nltk RCE — Fixed in 3.9.3