CVE-2026-55798
published 2026-07-06CVE-2026-55798: Pillow is a Python imaging library. Prior to 12.3.0, WindowsViewer.get_command() constructed a cmd.exe shell command by directly embedding a file path into an…
PriorityP425medium4.5CVSS 3.1
AVLACHPRNUIRSUCLILAL
EPSS
0.18%
7.5th percentile
Pillow is a Python imaging library. Prior to 12.3.0, WindowsViewer.get_command() constructed a cmd.exe shell command by directly embedding a file path into an f-string without escaping and passed the result to subprocess.Popen(..., shell=True), allowing shell metacharacters in the file path to inject arbitrary cmd.exe commands. This issue is fixed in version 12.3.0.
Affected
79 ranges· showing 25
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| ansible-automation-platform-25 | lightspeed-chatbot-rhel8 | — | — |
| ansible-automation-platform-26 | hub-rhel9 | — | — |
| ansible-automation-platform-26 | lightspeed-chatbot-rhel9 | — | — |
| ansible-automation-platform-27 | hub-rhel9 | — | — |
| ansible-automation-platform-27 | lightspeed-chatbot-rhel9 | — | — |
| ansible-automation-platform | automation-dashboard-rhel9 | — | — |
| exploit-intelligence-tech-preview | vulnerability-analysis-rhel9 | — | — |
| lightspeed-core | lightspeed-stack-rhel9 | — | — |
| openshift-lightspeed-tech-preview | lightspeed-rag-tool-rhel9 | — | — |
| openshift-lightspeed | lightspeed-ocp-rag-rhel9 | — | — |
| openshift-lightspeed | lightspeed-service-api-rhel9 | — | — |
| python-pillow | pillow | < 12.3.0 | 12.3.0 |
| python | pillow | < 12.3.0 | 12.3.0 |
| python | pillow | >= 0 < 12.3.0 | 12.3.0 |
| quay | quay-rhel8 | — | — |
| quay | quay-rhel9 | — | — |
| rhaii | model-opt-cuda-rhel9 | — | — |
| rhaii | vllm-cpu-rhel9 | — | — |
| rhaii | vllm-cuda-rhel9 | — | — |
| rhaii | vllm-gaudi-rhel9 | — | — |
| rhaii | vllm-neuron-rhel9 | — | — |
| rhaii | vllm-rocm-rhel9 | — | — |
| rhaii | vllm-spyre-rhel9 | — | — |
| rhaii | vllm-tpu-rhel9 | — | — |
| rhaiis | model-opt-cuda-rhel9 | — | — |
CVSS provenance
nvdv3.14.5MEDIUMCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
vendor_redhat4.5MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Red Hat
python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths
vendor_redhat·2026-07-06·CVSS 4.5
CVE-2026-55798 [MEDIUM] CWE-78 python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths
python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths
Pillow is a Python imaging library. Prior to 12.3.0, WindowsViewer.get_command() constructed a cmd.exe shell command by directly embedding a file path into an f-string without escaping and passed the result to subprocess.Popen(..., shell=True), allowing shell metacharacters in the file path to inject arbitrary cmd.exe commands. This issue is fixed in version 12.3.0.
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
GHSA
Pillow: WindowsViewer.get_command() OS command injection via unescaped shell path
ghsa·2026-07-20
CVE-2026-55798 [MEDIUM] CWE-78 Pillow: WindowsViewer.get_command() OS command injection via unescaped shell path
Pillow: WindowsViewer.get_command() OS command injection via unescaped shell path
### 1. Summary
`WindowsViewer.get_command()` constructs a `cmd.exe` shell command by directly embedding a
file path into an f-string without escaping. The result is passed to
`subprocess.Popen(..., shell=True)`. Shell metacharacters in the file path — most
importantly a double-quote (`"`) that breaks out of the wrapping, followed by `&` — allow
injection of arbitrary `cmd.exe` commands.
The macOS equivalent (`MacViewer`) correctly applies `shlex.quote()` to the same parameter.
The Linux equivalent (`UnixViewer`) does likewise. Windows is the only platform missing this
protection, despite `shlex.quote` being **already imported** on line 21 of `ImageShow.py`.
---
### 2. Vulnerable Code
**File:** `src/PIL/
VulDB
Pillow up to 12.2.0 Command Builder WindowsViewer.get_command os command injection
vuldb·2026-07-06·CVSS 4.5
CVE-2026-55798 [MEDIUM] Pillow up to 12.2.0 Command Builder WindowsViewer.get_command os command injection
A vulnerability categorized as critical has been discovered in Pillow up to 12.2.0. Affected is the function WindowsViewer.get_command of the component Command Builder. Such manipulation leads to os command injection.
This vulnerability is documented as CVE-2026-55798. The attack can be executed remotely. There is not any exploit available.
No detection rules found.
No public exploits indexed.
Bugzilla
CVE-2026-55798 python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths [epel-all]
bugzilla·2026-07-07·CVSS 4.5
CVE-2026-55798 [MEDIUM] CVE-2026-55798 python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths [epel-all]
CVE-2026-55798 python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths [epel-all]
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.
Pillow is a Python imaging library. Prior to 12.3.0, WindowsViewer.get_command() constructed a cmd.exe shell command by directly embedding a file path into an f-string without escaping and passed the result to subprocess.Popen(..., shell=True), allowing shell metacharacters in the file path to inject arbitrary cmd.exe commands. This issue is fixed in version 12.3.0.
Bugzilla
CVE-2026-55798 python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths [fedora-all]
bugzilla·2026-07-07·CVSS 4.5
CVE-2026-55798 [MEDIUM] CVE-2026-55798 python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths [fedora-all]
CVE-2026-55798 python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths [fedora-all]
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.
Pillow is a Python imaging library. Prior to 12.3.0, WindowsViewer.get_command() constructed a cmd.exe shell command by directly embedding a file path into an f-string without escaping and passed the result to subprocess.Popen(..., shell=True), allowing shell metacharacters in the file path to inject arbitrary cmd.exe commands. This issue is fixed in version 12.3.0.
Bugzilla
CVE-2026-55798 python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths
bugzilla·2026-07-06·CVSS 4.5
CVE-2026-55798 [MEDIUM] CVE-2026-55798 python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths
CVE-2026-55798 python-pillow: Pillow: Arbitrary command injection via shell metacharacters in file paths
Pillow is a Python imaging library. Prior to 12.3.0, WindowsViewer.get_command() constructed a cmd.exe shell command by directly embedding a file path into an f-string without escaping and passed the result to subprocess.Popen(..., shell=True), allowing shell metacharacters in the file path to inject arbitrary cmd.exe commands. This issue is fixed in version 12.3.0.
https://github.com/python-pillow/Pillow/blob/main/docs/releasenotes/12.3.0.rsthttps://github.com/python-pillow/Pillow/commit/8404ea5fe5df40fc34aa1e51403dd6fce0778b8ahttps://github.com/python-pillow/Pillow/commit/88194166691b7b603529b8b036ab3ab9cedd2de4https://github.com/python-pillow/Pillow/commit/b0e06caa64c1405aa3da0bb1d2bd9a77ca22de7fhttps://github.com/python-pillow/Pillow/security/advisories/GHSA-4x4j-2g7c-83w6https://github.com/python-pillow/Pillow/security/advisories/GHSA-4x4j-2g7c-83w6
2026-07-06
Published