CVE-2026-128138: NLTK incomplete fix: additional JVM/JAR sandbox bypass through unvalidated launcher tokens in java() command arguments
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. From 3.10.3 until 3.10.4, the NLTK 3.10.3 JVM hardening validates Java launcher tokens in the options channel but appends the caller-controlled cmd sequence without requiring its first token to be a main class. Supplying -jar or an @argfile through nltk.internals.java or StanfordSegmenter.javaclass can therefore execute attacker-selected Java bytecode without the unsafe-JAR opt-in. This issue is fixed in version 3.10.4.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.10.4
Event History
Frequently Asked Questions
Which deployments are exposed?
Deployments using NLTK from version 3.10.3 up to, but not including, 3.10.4 are affected when they invoke Java through nltk.internals.java or StanfordSegmenter.java_class with caller-controlled command arguments.
What does an attacker need to exploit this issue?
An attacker needs control over the cmd sequence passed to the affected Java invocation paths. They can supply -jar or an @argfile as the first command token to run attacker-selected Java bytecode without enabling the unsafe-JAR opt-in.
Is the JVM hardening in 3.10.3 sufficient protection?
No. Version 3.10.3 validates launcher tokens in the options channel, but does not require the first caller-controlled cmd token to be a main class.
What is the remediation?
Upgrade NLTK to version 3.10.4, which fixes the issue. Until upgrading, avoid passing caller-controlled cmd sequences to nltk.internals.java or StanfordSegmenter.java_class, particularly values that could begin with -jar or @argfile.