/

CVE-2026-128138

Severity:

CRITICAL RISK

(9.8)

Argument Injection (CWE-88) in NLTK Java Launcher API

CVE-2026-128138

Awaiting Analysis

Vulnerability type

Category:

Argument Injection

CWE:

CWE-77, CWE-88

Impact:

Attacker-Controlled Java Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

NLTK's Java launcher can pass caller-controlled command arguments to Java without requiring the first argument to identify a main class. If an attacker can influence that argument sequence or the relevant Java class setting, options such as -jar or an argument-file reference may cause attacker-selected Java bytecode to run.

Affected context

The issue is in NLTK's Java-launching paths, including nltk.internals.java and StanfordSegmenter.java_class, in the affected release range described for NLTK 3.10.3 before the fix in 3.10.4. Launcher tokens in the options channel are validated, but the caller-controlled command sequence is appended without requiring its first token to be a main class. The risk depends on whether an attacker can influence that sequence or the related configuration.

Exploit preconditions

  • Attack surface: NLTK code that launches Java through the affected launcher paths
  • Required access: Ability to influence the caller-controlled command sequence or relevant Java class setting; the description does not establish a particular access level
  • Trigger point: Java process launch
  • Why exploitation is possible: The command sequence is appended without enforcing that its first token is a main class, allowing Java launcher options such as -jar or an argument-file reference to alter what Java executes

Why this happens

This is an argument-injection flaw, primarily mapping to CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection'). The launcher validates one channel of Java options but does not sufficiently constrain a separate caller-controlled argument sequence. As a result, values intended as ordinary command arguments may be interpreted as Java launcher directives. The behavior is also related to CWE-77: Improper Neutralization of Special Elements used in a Command.

Potential impact

  • Attacker-selected Java bytecode may execute in the context of the NLTK process
  • The running process or its accessible data and resources could be compromised
  • Further systems or services may be affected if the process has access to them

General mitigation guidance

Defensive patterns include treating launcher arguments and class settings as untrusted, enforcing an explicit allowlist of permitted entry points, and rejecting launcher-control options or argument-file references where they are not required. Prefer APIs that keep executable selection separate from validated arguments, validate inputs before process creation, and run Java processes with only the privileges and resource access they need.

How teams detect issues like this

  • Use static analysis to flag process-launch code that combines caller-controlled values with Java launcher arguments.
  • Review code paths that append command sequences after validating a separate options channel, especially where a main class is not enforced.
  • Add policy checks for unexpected launcher-control options, argument-file references, and unapproved Java entry points.
  • Use automated code review tools as an additional way to surface risky process-argument construction.

Sources

SourceLink
github.comgithub.com/nltk/nltk/commit/b36212795a522d2b7b176cf0e0d9d8da489ba6e6
github.comgithub.com/nltk/nltk/pull/3771
github.comgithub.com/nltk/nltk/releases/tag/v3.10.4
github.comgithub.com/nltk/nltk/security/advisories/GHSA-x8q7-6c7m-52gw

Frequently asked

questions

The description does not establish a direct remote attack path. Exploitation depends on whether an attacker can influence the command sequence or related Java class setting.

An attacker needs a way to control those inputs, such as through an application feature or configuration path that passes attacker-influenced values to the affected Java launcher.

Restrict Java entry points and arguments with explicit validation, and prevent untrusted values from being interpreted as Java launcher directives.

Keep executable selection separate from data arguments, validate inputs at the process boundary, and use static analysis and code review policies to identify unsafe command construction.

Find out what's already
exploitable in your codebase.