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…

NLTK (Natural Language Toolkit) before version 3.9.3 contains an eval injection vulnerability in the nltk.collocations module that allows an… (CVE-2025-71408)

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

Description

NLTK (Natural Language Toolkit) versions before 3.9.3 contain an eval injection vulnerability in the nltk.collocations module. This vulnerability allows an attacker who can control command-line arguments to execute arbitrary Python code. The issue arises because the __main__ block in collocations.py passes command-line arguments directly to eval() without validation or sanitization, enabling execution of arbitrary code including OS commands via the os module.

CVSS v4.0

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
Scope
X
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

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: 07/26/2026, 03:44:05 UTC

Views: 4

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