CVE Catalog

CVE-2025-71408

HighCVSS 7.8
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.16%

5th percentile - higher than 5% of all known CVEs

Summary

NLTK (Natural Language Toolkit) before version 3.9.3 contains an eval injection vulnerability in the nltk.collocations module. When collocations.py is invoked directly, command-line arguments are passed to eval() without validation, allowing an attacker to execute arbitrary Python code, including OS commands via the os module.

Risk Assessment

Organizations using NLTK in scripts processing command-line arguments are at risk of remote code execution by an attacker controlling those arguments.

Recommendation

Update NLTK to version 3.9.3 or later.

Other vulnerabilities in NLTK

See all
Original NVD description (English source)

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.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS