Arbitrary Argument Injection Affecting nltk package, versions [3.10.3,3.10.4)


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.73% (50th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary Argument Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-NLTK-22733179
  • published22 Nov 2026
  • disclosed19 Nov 2026
  • creditUnknown

Introduced: 19 Nov 2026

NewCVE-2026-128138  (opens in a new tab)
CWE-77  (opens in a new tab)
CWE-88  (opens in a new tab)

How to fix?

Upgrade nltk to version 3.10.4 or higher.

Overview

nltk is a Natural Language Toolkit (NLTK) is a Python package for natural language processing.

Affected versions of this package are vulnerable to Arbitrary Argument Injection via the nltk.internals.java() function, which appends the caller-supplied cmd sequence to the Java subprocess command without validating that its first token is a Java main-class name. An attacker who can influence the leading item of the cmd argument - or the java_class constructor argument of StanfordSegmenter, which is placed at the head of that sequence - can supply a launcher switch such as -jar or an @argfile reference, causing the Java launcher to execute an attacker-controlled JAR with the privileges of the NLTK process. The 3.10.3 hardening blocked these tokens in the options channel but left the cmd channel unvalidated, providing a complete bypass of that remediation.

Note: This is only exploitable when an embedding application exposes attacker influence over the leading item of nltk.internals.java(cmd=...), or over StanfordSegmenter(java_class=...) or an equivalent wrapper-controlled command token, and the attacker can reference a JAR or argument file readable by the NLTK process.

PoC

The complete reproducer, machine-readable proof results, and proposed remediation are included in the attached evidence package.

nltk-3103-candidate-a-maintainer-evidence.zip

The included reproducer/reproduce_cmd_channel_bypass.py creates only temporary researcher-controlled Java source, JAR, argument-file, and marker artifacts. It performs no network access.

Requirements:

  • Python 3.10 or newer
  • nltk==3.10.3
  • a JDK providing java, javac, and jar

Run:

python reproducer/reproduce_cmd_channel_bypass.py

A confirmed run exits with status 0 and reports that:

  • the options channel blocks @argfile;
  • the direct cmd channel executes the external JAR 3/3;
  • the higher-level StanfordSegmenter.java_class channel executes it 3/3; and
  • legitimate trusted main-class execution remains functional.

Note: The PoC states it requires Python 3.10 or newer, nltk==3.10.3, and a JDK providing java, javac, and jar.

CVSS Base Scores

version 4.0
version 3.1