LiveActive security incident?Get immediate response
CVE Record

CVE-2025-71408: NLTK < 3.9.3 Eval Injection via collocations.py Command-Line Arguments

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.

HighCVSS 8.5Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

NLTK versions before 3.9.3 can execute unintended Python code when collocations.py is run directly with attacker-controlled command-line arguments. Exploitation requires local command invocation or an application that passes untrusted input into that command. Successful abuse could compromise data and the host process.

Executive priority

Prioritize near-term remediation on systems where untrusted users, jobs, or services can influence command arguments. Other installations should enter the normal high-severity patch cycle after confirming usage. The local prerequisite reduces broad remote exposure, but successful exploitation could fully compromise the executing process and its accessible data.

Technical view

The collocations.py __main__ block passes command-line values to eval() as suffixes of BigramAssocMeasures. Without an allowlist or sanitization, a crafted expression can escape the intended attribute lookup and execute arbitrary Python code. The supplied CVSS 4.0 score is 8.5, with local access and low privileges required.

Likely exposure

Exposure is limited to systems running NLTK before 3.9.3 where collocations.py is invoked directly and an attacker can influence its command-line arguments. Merely importing or using unrelated NLTK functionality is not shown to be vulnerable by the supplied evidence. Automation and wrappers should be reviewed for argument provenance.

Exploitation context

A public researcher disclosure and advisory exist, but the bundle does not establish active exploitation and the CVE is not listed as KEV. The attack vector is local, requires low privileges, needs no user interaction, and may cause high confidentiality, integrity, and availability impact.

Researcher notes

The supplied affected-product entry says “ntlk” version “0,” which conflicts with the narrative and patch references identifying NLTK before 3.9.3. Treat that structured entry as unreliable and validate the actual Python package. The patch commit and pull request support a code-level fix; the bundle provides no evidence of exploitation in the wild.

Mitigation direction

  • Upgrade NLTK to version 3.9.3 or later, following the official release guidance.
  • Prevent untrusted input from reaching collocations.py command-line arguments.
  • Avoid invoking collocations.py directly until affected environments are upgraded.
  • Apply least privilege to processes and automation that execute NLTK utilities.

Validation and detection

  • Inventory installed NLTK versions and identify every instance below 3.9.3.
  • Search application code and automation for direct execution of collocations.py.
  • Trace whether external or lower-trust input can influence its command-line arguments.
  • Confirm upgraded environments report NLTK 3.9.3 or later.
  • Review process and audit logs for unexpected direct collocations.py invocations.
Prepared
Confidence
medium
Sources
7

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-95: Code execution behavior lookup

Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2025-71408 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.5 (4.0)
Known Exploited
No
Published

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

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

2CVSS vectors
3Timeline events
1ADP providers
6Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: pocAutomatable: noTechnical Impact: total

CVSS vector scores

2 official scores

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.5CVSS 4.0HighCVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NVulnCheck
7.8CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H1.85.9VulnCheck

Vulnerability scoring details

Base CVSS 4.0 score

8.5High
CVSS 4.0 vector shape for CVE-2025-71408Attack VectorAttack ComplexityAttack RequirementsPrivileges RequiredUser InteractionVS ConfidentialityVS IntegrityVS AvailabilitySS ConfidentialitySS IntegritySS Availability

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

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Attack Requirements
NonePresent
Privileges Required
NoneLowHigh
User Interaction
NonePassiveActive
VS Confidentiality
HighLowNone
VS Integrity
HighLowNone
VS Availability
HighLowNone
SS Confidentiality
HighLowNone
SS Integrity
HighLowNone
SS Availability
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. CVE publishedCVE Program

    The CVE record was published.

  3. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
ntlkntlk0affected
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-95 · source CWE mapping

Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')

Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.