CVE-2026-0848

Arbitrary Code Execution in NLTK StanfordSegmenter via Untrusted JAR Loading

State
Published
Severity
10.0 Critical
Published
Mar 5, 2026
Updated
Mar 6, 2026
Reserved
Jan 10, 2026

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.010.0 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H@huntr_ai

Weaknesses

  • CWE-20 Improper Input Validation

Affected Products

ProductVersions
nltk/nltknltk
  • latest and earlierAffected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.