Description
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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| nltk | nltk/nltk | unspecified – ≤ latest | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | nltk | 3.9.3-1 | — |
| Debian 13 | nltk | No fix yet | — |
| Debian 12 | nltk | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | nltk | No fix yet | — |
| Ubuntu 25.10 | nltk | No fix yet | — |
Show 5 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 26.04 LTS | nltk | 3.9.2-1ubuntu0.1~esm2 | — |
| Ubuntu Pro 24.04 LTS | nltk | 3.8.1-1ubuntu0.1~esm2 | — |
| Ubuntu Pro 22.04 LTS | nltk | 3.7-1ubuntu0.1~esm2 | — |
| Ubuntu Pro 20.04 LTS | nltk | 3.4.5-2ubuntu0.1~esm4 | — |
| Ubuntu Pro 18.04 LTS | nltk | 3.2.5-1ubuntu0.1+esm4 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 3 repositories
-
fevar54/CVE-2026-0848-PoC-Improper-Input-Validation ★ 0 · Mar 31, 2026
PoC de CVE-2026-0848: validacion de entrada indebida en NLTK que permite ejecucion de codigo via StanfordSegmenter.
-
fevar54/CVE-2026-0848-Scanner---Herramienta-de-Detecci-n ★ 0 · Mar 31, 2026
Scanner de CVE-2026-0848: detecta instalaciones de NLTK 3.9.2 o inferiores vulnerables. Reportes JSON/HTML/CSV.
-
HyperPS/CVE-2026-0848 ★ 0 · Mar 29, 2026
nltk.tokenize.StanfordSegmenter dynamically loads external Java .jar files without verification or sandboxing. If an attacker can supply or replace the JAR (e.g., a poisoned model download, MITM pack…
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | nltk | < 3.9.3 | 3.9.3 | PYSEC-2026-99 |