NLTK
CVE-2026-0848
CRITICAL
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify NLTK application using StanfordSegmenter
-
DeliveryPosition for JAR file replacement (MITM/filesystem access/supply chain)
-
ExploitCraft malicious JAR with payload in static initializer
-
ExecutionApplication imports StanfordSegmenter module
-
PersistPython subprocess invokes JVM with malicious JAR
-
ImpactArbitrary 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – 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)
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
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)AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
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
Lifecycle Timeline
2DescriptionCVE.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- 7 pypi packages depend on nltk (7 direct, 0 indirect)
Ecosystem-wide dependent count for version 3.9.3.
Executive ViewAI
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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
Arbitrary code execution in the Natural Language Toolkit (NLTK) before 3.10.3 allows attackers to bypass the library's p
Arbitrary code execution in NLTK (Natural Language Toolkit) through 3.9.4 allows attackers to run Python code when a vic
Arbitrary code execution in the NLTK (Natural Language Toolkit) Python library affects all versions through its data dow
StreamBackedCorpusView in NLTK before 3.10.0 allows arbitrary local file reads by calling Python's builtins.open() direc
Symlink-based path traversal in NLTK's FramenetCorpusReader before version 3.10.2 permits attackers with write access to
CPU exhaustion in NLTK's ConllCorpusReader.srl_instances() lets an attacker who supplies a crafted CoNLL SRL corpus pin
CPU exhaustion in NLTK's Tree.chomsky_normal_form() right-factor binarization affects NLTK through 3.10.3 and lets remot
Quadratic CPU exhaustion in NLTK's CCG lexicon parser (nltk.ccg.lexicon.fromstring, also re-exported as nltk.ccg.chart.f
Denial of service in NLTK before 3.10.4 allows remote attackers to pin a CPU core and exhaust bounded worker pools by ca
Unbounded recursion in NLTK's JSONTaggedDecoder.decode_obj() (nltk/jsontags.py) allows unauthenticated remote attackers
Path traversal and pickle deserialization protections in NLTK before 3.10.0 are effectively disabled by default - pathse
XML Entity Expansion (Billion Laughs) in NLTK before 3.10.3 allows unauthenticated remote attackers to cause denial of s
NVD
CVE.org
EPSS
GitHub PoC
Exploit-DB