CVE-2025-71408

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

Published Jul 24, 2026 CVSS 4.0 · 8.5 High EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-848c-c2cx-j7qx NLTK vulnerable to Eval Injection via collocations CLI arguments
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Ntlk
Ntlk ntlk
Vendors & Products Ntlk
Ntlk ntlk
Type Values Removed Values Added
Title NLTK < 3.9.2 Eval Injection via collocations.py Command-Line Arguments NLTK < 3.9.3 Eval Injection via collocations.py Command-Line Arguments
Type Values Removed Values Added
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.
Title NLTK < 3.9.2 Eval Injection via collocations.py Command-Line Arguments
Weaknesses CWE-95
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.5, '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'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 8, 2026, 3:21 PM
Reserved
Jul 24, 2026, 8:57 PM
Status
Analyzed
Published
Jul 24, 2026, 10:16 PM
Modified
Oct 8, 2026, 4:16 PM