Skip to main content

NLTK CVE-2026-0848

CRITICAL
Improper Input Validation (CWE-20)
2026-03-05 security@huntr.dev
Critical
Disputed · 10.0 NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify NLTK application using StanfordSegmenter
  2. Delivery
    Position for JAR file replacement (MITM/filesystem access/supply chain)
  3. Exploit
    Craft malicious JAR with payload in static initializer
  4. Execution
    Application imports StanfordSegmenter module
  5. Persist
    Python subprocess invokes JVM with malicious JAR
  6. Impact
    Arbitrary Java bytecode executes with application privileges

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
Exploitation Conditions

Exploitation requires the target application to specifically import and use the StanfordSegmenter module from NLTK (not a default or commonly used component). The attacker must additionally achieve one of three preconditions: (1) Control over the JAR file location through model poisoning by replacing legitimate Stanford NLP JAR files in the filesystem location where NLTK expects them, requiring write access to that directory. (2) Network position to perform MITM attacks during JAR file download if the application dynamically fetches Stanford NLP components over unencrypted channels. (3) Supply chain compromise where malicious JARs are distributed through compromised package repositories or dependency confusion. The vulnerability triggers automatically at import time without requiring specific API calls or user input beyond module initialization. Limiting factors: requires Java Runtime Environment installed on target system, requires application to use Chinese text segmentation functionality specifically, and exploitation complexity increases significantly if JAR files are pre-validated or loaded from read-only filesystems.

Impact

The CVSS 10.0 score (AV:N/AC:L/PR:N/UI:N/S:C) indicates maximum theoretical severity with network-accessible, unauthenticated exploitation requiring no user interaction and causing scope change. However, real-world risk assessment reveals critical nuances: exploitation requires the victim application to specifically use the StanfordSegmenter module (not a default NLTK component) AND either control over the JAR file location (model poisoning), network position for MITM during download, or supply chain compromise. The EPSS score of 0.48% despite public disclosure suggests attackers find the exploitation prerequisites limiting compared to simpler RCE vectors. Absence from CISA KEV indicates no confirmed active exploitation campaigns. SSVC analysis: exploitation is PUBLIC (technical details available), AUTOMATABLE is partial (requires specific NLTK module usage), TECHNICAL IMPACT is total (arbitrary code execution). Priority depends heavily on whether your environment uses StanfordSegmenter with external/untrusted JAR sources - high priority if yes, lower if NLTK is installed but this module unused.

Exploit ScenarioDerived

An attacker identifies a web application using NLTK's StanfordSegmenter for processing user-submitted Chinese text. The attacker performs a man-in-the-middle attack during the application's initial setup when it downloads Stanford NLP JAR files, or exploits a misconfigured deployment where JAR files are loaded from a writable directory. The attacker replaces the legitimate stanford-segmenter.jar with a malicious version containing a backdoor payload in the JAR's static initialization block. When the Python application imports the StanfordSegmenter module, it automatically invokes the JVM with the poisoned JAR file via subprocess, executing the attacker's Java bytecode with the application's privileges, establishing persistence and exfiltrating data.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Apr 21, 2026

Remote code execution in NLTK (Natural Language Toolkit) versions ≤3.9.2 allows unauthenticated attackers to execute arbitrary Java bytecode through the StanfordSegmenter module's unvalidated loading of external JAR files. The vulnerability is exploitable via model poisoning, MITM attacks during JAR downloads, or dependency poisoning, with execution occurring automatically at import time. Despite a critical CVSS 10.0 score, EPSS probability of 0.48% (65th percentile) suggests low observed exploitation activity. No CISA KEV listing indicates no confirmed widespread active exploitation, though the vulnerability is publicly documented on huntr.com with technical details available.

Earlier versions of this analysis (1)
v1 Mar 12, 2026 - 22:06 CVSS 10.0

Code execution in NLTK StanfordSegmenter.

RemediationAI

Upgrade NLTK to version 3.9.3 or later when available, monitoring the official NLTK GitHub repository and PyPI for patched releases addressing this vulnerability per the huntr.com advisory at https://huntr.com/bounties/08b109bb-ac24-403f-9422-1c246ce60202. Until patched versions are released, implement compensating controls: (1) Pin JAR file versions using cryptographic hash verification before loading, checking SHA256 checksums against known-good values from official Stanford NLP releases - this prevents MITM and poisoning attacks but requires manual hash management. (2) Restrict filesystem permissions on JAR file directories to read-only for the application user and limit write access to trusted administrators only - mitigates local file replacement but not supply chain attacks. (3) If feasible, isolate NLTK processing in containerized environments with egress filtering to prevent post-exploitation lateral movement - adds defense-in-depth but doesn't prevent initial compromise. (4) Audit applications to identify if StanfordSegmenter is actually used; if not required, remove or disable the module entirely - zero risk but loses Chinese segmentation functionality.

Affected Packages

pypi nltk fix: 3.9.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

NLTK (Natural Language Toolkit) is a Python library for natural language processing that integrates with Stanford NLP tools through Java interoperability. The StanfordSegmenter module uses Python's subprocess module to invoke external JAR files containing Stanford's Chinese word segmenter. The vulnerability stems from CWE-20 (Improper Input Validation) where the classpath parameter passed to the JVM is not sanitized or validated. The module loads JAR files without verifying cryptographic signatures, checking file integrity, or implementing sandbox restrictions on the Java execution environment. This creates a code injection vector at the boundary between Python and Java runtime environments, where malicious JAR files containing arbitrary Java classes can be executed with the privileges of the Python process.

Know when Nltk gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Sources disagree (Low–Critical)
NVD PRIMARY 10.0 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
SUSE 3.1 LOW
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Analysis Updated
Apr 21, 2026 - 15:12 vuln.today
v2 - CVSS changed
CVE Published
Mar 05, 2026 - 21:16 nvd
CRITICAL 10.0

DescriptionCVE.org

NLTK versions <=3.9.2 are vulnerable to arbitrary code execution due to improper input validation in the StanfordSegmenter module. The module dynamically loads external Java .jar files without verification or sandboxing. An attacker can supply or replace the JAR file, enabling the execution of arbitrary Java bytecode at import time. This vulnerability can be exploited through methods such as model poisoning, MITM attacks, or dependency poisoning, leading to remote code execution. The issue arises from the direct execution of the JAR file via subprocess with unvalidated classpath input, allowing malicious classes to execute when loaded by the JVM.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 7 pypi packages depend on nltk (7 direct, 0 indirect)

Ecosystem-wide dependent count for version 3.9.3.

Executive ViewAI

Why It Matters

NLTK (Natural Language Toolkit) versions 3.9.2 and earlier contain a critical remote code execution vulnerability in the StanfordSegmenter module that allows unauthenticated attackers to execute arbitrary code by poisoning externally loaded JAR files, exploitable through man-in-the-middle attacks or supply chain compromise. Any application using NLTK for natural language processing faces immediate risk of full system compromise, particularly those processing untrusted text or operating in network-constrained environments. Organizations must immediately identify and isolate affected deployments until vendor remediation is available.

Business Impact: Severe
Compensating Controls

Pending vendor patch availability. Interim mitigations: (1) Disable StanfordSegmenter module and use alternative NLTK tokenizers; (2) Enforce strict network segmentation-block all outbound JAR downloads from application servers; (3) Pin all NLTK dependencies with hash verification in package managers; (4) Implement application allowlisting to prevent execution of unsigned JAR files; (5) Monitor process execution logs for unexpected Java bytecode execution; (6) Run NLTK-dependent applications in containerized environments with minimized privileges and read-only filesystems where possible.

Threat Intelligence Overview

EPSS Score
0.5%
Top 35% exploitable
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +50
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)CVE.org

cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*

More in Nltk

View all
CVE-2026-79657 CRITICAL POC
9.3 Aug 25

Arbitrary code execution in the Natural Language Toolkit (NLTK) before 3.10.3 allows attackers to bypass the library's p

CVE-2026-78683 CRITICAL POC
9.4 Aug 25

Arbitrary code execution in NLTK (Natural Language Toolkit) through 3.9.4 allows attackers to run Python code when a vic

CVE-2025-14009 HIGH POC
8.8 Feb 18

Arbitrary code execution in the NLTK (Natural Language Toolkit) Python library affects all versions through its data dow

CVE-2026-63312 HIGH POC
8.7 Aug 22

StreamBackedCorpusView in NLTK before 3.10.0 allows arbitrary local file reads by calling Python's builtins.open() direc

CVE-2026-62384 HIGH POC
8.7 Aug 22

Symlink-based path traversal in NLTK's FramenetCorpusReader before version 3.10.2 permits attackers with write access to

CVE-2026-126297 HIGH POC
8.7 Nov 13

CPU exhaustion in NLTK's ConllCorpusReader.srl_instances() lets an attacker who supplies a crafted CoNLL SRL corpus pin

CVE-2026-126298 HIGH POC
8.7 Nov 13

CPU exhaustion in NLTK's Tree.chomsky_normal_form() right-factor binarization affects NLTK through 3.10.3 and lets remot

CVE-2026-126299 HIGH POC
8.7 Nov 13

Quadratic CPU exhaustion in NLTK's CCG lexicon parser (nltk.ccg.lexicon.fromstring, also re-exported as nltk.ccg.chart.f

CVE-2026-126303 HIGH POC
8.7 Nov 13

Denial of service in NLTK before 3.10.4 allows remote attackers to pin a CPU core and exhaust bounded worker pools by ca

CVE-2026-66393 HIGH POC
8.7 Aug 22

Unbounded recursion in NLTK's JSONTaggedDecoder.decode_obj() (nltk/jsontags.py) allows unauthenticated remote attackers

CVE-2026-62388 HIGH POC
8.7 Aug 22

Path traversal and pickle deserialization protections in NLTK before 3.10.0 are effectively disabled by default - pathse

CVE-2026-78681 HIGH POC
8.7 Aug 25

XML Entity Expansion (Billion Laughs) in NLTK before 3.10.3 allows unauthenticated remote attackers to cause denial of s

Vendor StatusVendor

SUSE

Severity: Low

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy