Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.2%top 90%

NLTK vulnerable to Eval Injection via collocations CLI arguments (CVE-2025-71408)

0
High
Published: 07/25/2026 (07/25/2026, 00:31:47 UTC)
Source: GCVE Database
Product: nltk

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.

CVSS v3.1

Score 7.8high

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected software

nltk
pkg:pypi/nltk
Affected versions
<3.9.3

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/25/2026, 23:48:07 UTC

Technical Analysis

The vulnerability in NLTK before version 3.9.3 is an eval injection in the nltk.collocations module. When collocations.py is run directly, the __main__ block uses eval() on command-line arguments as suffixes of BigramAssocMeasures without any allowlist or sanitization. This allows an attacker controlling the command-line arguments to inject and execute arbitrary Python code, including operating system commands through the os module. This is classified as CWE-95 (Improper Control of Generation of Code).

Potential Impact

An attacker with the ability to supply command-line arguments to the vulnerable module can execute arbitrary Python code on the system. This can lead to full code execution, including running OS commands, potentially compromising the host environment. The vulnerability requires local or limited access (local vector) and low complexity to exploit, with no user interaction needed. It has a high impact on confidentiality, integrity, and availability.

Mitigation Recommendations

A fixed version is available starting from NLTK version 3.9.3. Users should upgrade to version 3.9.3 or later to remediate this vulnerability. No other mitigations are indicated. Patch status is not explicitly confirmed in the provided data, but the vulnerability is described as fixed in version 3.9.3, so upgrading to this version or later is recommended.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-848c-c2cx-j7qx
Osv Schema Version
1.4.0
Aliases
["CVE-2025-71408"]
Ecosystems
[]
Database Specific Severity
HIGH
Cvss Version
4.0

Threat ID: 6a6542169c2644c7f8087919

Added to database: 07/25/2026, 23:09:10 UTC

Last enriched: 07/25/2026, 23:48:07 UTC

Last updated: 09/07/2026, 10:52:06 UTC

Views: 58

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses