CVE Database›Document archive›CVE-2026-55798

CVE-2026-55798

python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths

Loading…

Severity

Moderate

Red Hat Product Security

4.5

CVSS 3.1

Review impact separately from score.

Published · July 7, 2026

Updated · November 1, 2026

Description

A flaw was found in Pillow, a Python imaging library. The WindowsViewer.get_command() function constructed a command-line interface (CLI) shell command by directly embedding a file path without proper escaping. This allowed shell metacharacters within the file path to inject arbitrary commands into cmd.exe. An attacker could exploit this to execute unauthorized commands on the system.

Statement

A flaw was found in Pillow, a Python imaging library. The WindowsViewer.get_command() method constructs a cmd.exe shell command by directly embedding a file path into an f-string without applying shlex.quote() or equivalent escaping. This string is then passed to subprocess.Popen with shell=True, allowing shell metacharacters in the file path to inject and execute arbitrary cmd.exe commands. The vulnerability is specific to the Windows platform; the Linux (UnixViewer) and macOS (MacViewer) equivalents already apply proper shell quoting.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Mitigation

No mitigation is specified in collected source.

CVSS / CWE

CVSS 3.1 · 4.5
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L

CWE-78 · Improper Neutralization of Special Elements used in an OS Command