Skip to content
DayZeroHub
Critical CVSS 9.8GHSA-x8q7-6c7m-52gwCVE-2026-128138

NLTK: incomplete earlier fix allows external JAR execution through java() command arguments

nltk nltk

Summary

NLTK 3.10.3 does not validate the first item of the command sequence passed to nltk.internals.java(), which bypasses the restrictions added in that release and allows an external JAR to run. The source states that version 3.10.4 contains the fix.

What happened

NLTK 3.10.3 hardened nltk.internals.java() so that its options list rejects Java argument-file references (@file) and launcher modes such as -jar. However, another channel remains: the caller-provided command sequence is appended to the Java command without checking that its first item is a main-class name. Java therefore treats leading tokens such as -jar or @file as launcher control arguments. According to the source, this was confirmed in two ways: direct use of the public java() helper, and through StanfordSegmenter, whose public java_class argument becomes the first item of that sequence. In both cases an external JAR controlled by the researcher was executed without enabling the settings or parameters that authorize untrusted JARs or classpaths. The source describes this as an additional bypass of the 3.10.3 fix and classifies it under CWE-77 and CWE-88.

Why it matters

The vulnerability is rated critical, with a CVSS 3.1 score of 9.8 (vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, per GHSA). It bypasses the 3.10.3 controls on JVM arguments and JAR execution, so external code can run in the Java process launched by NLTK. The source does not indicate active exploitation in CISA's KEV catalog.

Affected products and versions

nltk (PyPI): versions >= 3.10.3, < 3.10.4. Fixed version: 3.10.4.

ProductVersionsFixed in
nltk>= 3.10.3, < 3.10.43.10.4
nltk nltk>= 3.10.3, < 3.10.4—

Action recommended by the source

The vendor fixes the issue in nltk version 3.10.4 (see the v3.10.4 release, pull request 3771 and the associated commit in the project repository). The source does not state any other mitigations.

Fixed in: 3.10.4

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-77, CWE-88

Relevant change history

  1. Published

    Advisory published.

Summary written with AI assistance from the source data. See the sources and references for complete information. View sources