CVE-2026-128138: Incomplete NLTK Launcher-Token Fix Enables JVM/JAR Sandbox Bypass via java() Command Injection
What's Happening
CVE-2026-128138 is an incomplete-fix command-injection and argument-injection vulnerability (CWE-77, CWE-88) in NLTK's internal java() helper (nltk.internals.java). NLTK 3.10.3 attempted to close off Java launcher control tokens — specifically -jar and @argfile — but it only validated the options channel passed to the helper. The caller-supplied cmd sequence itself was left unvalidated.
If an attacker controls the first token of that cmd sequence — either by calling nltk.internals.java directly or indirectly through StanfordSegmenter's java_class argument — they can smuggle a -jar switch or an @argfile reference into the invocation. The Java launcher doesn't care which code path put it there: it interprets these tokens as launcher control arguments rather than as a main class name, and executes an attacker-selected JAR. The practical impact is arbitrary attacker-controlled Java bytecode execution with the privileges of the host NLTK process, which defeats the sandbox the original fix was meant to enforce.
Affected Software
- Vendor/package: pip —
nltk - Affected versions: >= 3.10.3, < 3.10.4
- Fixed in: 3.10.4
- CVSS: 9.8
Exploitation Status
This flaw is currently classified as theoretical — there is no known public exploit and it is not in any KEV catalog. That said, a 9.8 CVSS score reflects the severity if it is weaponized: full code execution via a trivial argument-smuggling trick into any Java process spawned by NLTK. Defenders running affected versions should prioritize patching to 3.10.4 and not wait for public exploitation evidence given the triviality of the bypass once a vulnerable call path is identified.
How Our Detection Catches It
Coverage ships for Microsoft Sentinel (KQL), Splunk (SPL), Elastic (EQL), QRadar (AQL), Sumo Logic, Chronicle (YARA-L), and CrowdStrike (CQL). The detection logic focuses on two complementary signal sets:
- Process telemetry: identifying Python processes that load NLTK and subsequently spawn a child
javaprocess whose command line contains suspicious or injected launcher tokens — notably-jaror@argfilereferences appearing where a main class name is expected. - Package-inventory signals: flagging hosts with an installed NLTK version in the vulnerable range (>= 3.10.3, < 3.10.4), so defenders can prioritize patching before correlating with the runtime behavior above.
Combining parent-child process lineage (Python → java) with launcher-argument inspection lets the rules distinguish legitimate NLTK/Stanford tooling invocations from an injected JAR execution attempt, without relying on exploit-specific signatures.
Full Detection
For the complete KQL, SPL, and other SIEM queries, MITRE ATT&CK mapping, investigation guidance, and atomic tests for this detection, see the CVE-2026-128138 detection page.