Skip to main content

Pillow CVE-2026-55798

| EUVDEUVD-2026-41898 MEDIUM
OS Command Injection (CWE-78)
2026-07-06 GitHub_M GHSA-4x4j-2g7c-83w6 PYSEC-2026-2257
4.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Deliver crafted filename containing cmd.exe metacharacters
  2. Delivery
    User or application triggers WindowsViewer on the file
  3. Exploit
    get_command() interpolates raw path into shell command string
  4. Execution
    subprocess.Popen executes injected cmd.exe commands
  5. Impact
    Arbitrary command execution as invoking user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation is strictly limited to Windows systems, as WindowsViewer targets cmd.exe and is not invoked on Linux or macOS. The attacker must control or meaningfully influence the file path - specifically the filename - passed to WindowsViewer.get_command(); this is the concrete triggering condition stated in the CVE description (direct embedding of a file path without escaping). A user must actively trigger the image viewing operation (UI:R per CVSS). High attack complexity (AC:H) reflects the prerequisite that an attacker-controlled filename must reach this specific code path - applications that source filenames exclusively from trusted internal sources are not exploitable. Pillow deployments that do not use the WindowsViewer component at all (the majority of server-side and cross-platform use cases) have no exposure.

Impact

The CVSS 3.1 score of 4.5 with vector AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L reflects a realistic but bounded threat. The local attack vector (AV:L) constrains exploitation to scenarios where the attacker can place or influence a file path on the target system - ruling out direct remote exploitation over the network. High attack complexity (AC:H) further limits the attack surface to cases where an attacker-controlled filename reaches the WindowsViewer code path. User interaction (UI:R) is required, meaning a user must actively trigger the image viewer. The impact triad of C:L/I:L/A:L indicates that commands execute in the context of the invoking user, not as elevated privilege. No EPSS data was provided, no KEV listing exists, and no public POC has been identified - all consistent with a low-urgency but real vulnerability in a specific Windows code path. This is a genuine issue for Windows-based Python applications that pass user-influenced file paths to Pillow's viewer functionality, but not a broad-scope emergency for server-side or non-Windows deployments.

Exploit ScenarioDerived

An attacker uploads or delivers a file with a crafted name such as legitimate.jpg & net user backdoor P@ssw0rd /add to a Windows environment where a Python application uses Pillow's WindowsViewer to open images. When a user or automated process triggers image display via get_command(), the unsanitized filename is embedded into the cmd.exe command string, causing the appended shell command to execute with the permissions of the invoking process. No public POC has been identified at time of analysis, but the attack primitive is straightforward for anyone familiar with Windows shell injection.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 06, 2026

Command injection in Pillow's WindowsViewer component (all versions prior to 12.3.0) allows arbitrary cmd.exe command execution when a user opens an image with a crafted filename containing shell metacharacters. The root cause is in WindowsViewer.get_command(), which embeds an unsanitized file path directly into an f-string and passes the result to subprocess.Popen with shell=True on Windows. No public exploit has been identified at time of analysis, and this vulnerability is not listed in the CISA KEV catalog.

RemediationAI

Upgrade Pillow to version 12.3.0 or later, which addresses this vulnerability via three commits: 8404ea5fe5df40fc34aa1e51403dd6fce0778b8a, 88194166691b7b603529b8b036ab3ab9cedd2de4, and b0e06caa64c1405aa3da0bb1d2bd9a77ca22de7f, as confirmed by the vendor advisory at https://github.com/python-pillow/Pillow/security/advisories/GHSA-4x4j-2g7c-83w6. If upgrading immediately is not possible, the most effective workaround is to avoid invoking WindowsViewer.get_command() with any file path derived from untrusted input - for example, by sanitizing filenames to strip or reject shell metacharacters before they reach this code path; note that blocklist-based sanitization carries inherent bypass risk and should be considered a temporary measure only. Applications on Linux or macOS are not affected and require no action.

Affected VersionsENISA

Pillow < 12.3.0

Affected Packages

pypi pillow fix: 12.3.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Pillow (python-pillow/Pillow) is the dominant Python imaging library, forked from PIL. The affected component, WindowsViewer.get_command(), is Windows-specific and invokes cmd.exe to open images using the native Windows viewer. The vulnerability stems from unsafe use of Python's subprocess.Popen with shell=True combined with f-string interpolation of an attacker-influenced file path - a textbook instance of CWE-78 (Improper Neutralization of Special Elements used in an OS Command). Characters such as &, |, and ; are not escaped or sanitized, allowing them to be interpreted by cmd.exe as command separators or chain operators. The CPE cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:* covers all pre-12.3.0 versions across platforms, though exploitation is limited to Windows deployments that invoke this viewer code path.

Know when Pillow gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 4.5 MEDIUM
AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
vuln.today AI 4.5 MEDIUM

Local vector and high complexity reflect that attacker-controlled filename must reach the Windows-only viewer code path; no system privileges required but user must trigger viewing.

3.1 AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
4.0 AV:L/AC:H/AT:P/PR:N/UI:A/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
Red Hat 4.5 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
High
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

Lifecycle Timeline

2
Patch available
Jul 06, 2026 - 20:02 EUVD
CVE Published
Jul 06, 2026 - 18:44 cve.org
MEDIUM 4.5

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 6,879 pypi packages depend on pillow (1,431 direct, 5,517 indirect)

Ecosystem-wide dependent count for version 12.3.0.

Threat Intelligence Overview

EPSS Score
0.1%
Top 98% exploitable
Prevalence
High
dominant Python imaging library used across millions of Python applications
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +22
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

More in Pillow

View all
CVE-2022-30595 CRITICAL POC
9.8 May 25

libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files. Rated

CVE-2026-59204 HIGH POC
8.7 Jul 14

Denial of service in Python Pillow (versions 8.2.0 through 12.2.0) allows remote attackers to exhaust memory during JPEG

CVE-2026-54058 HIGH POC
8.3 Jul 14

Out-of-bounds memory disclosure in Python Pillow before 12.3.0 lets an attacker who supplies a crafted McIdas AREA image

CVE-2026-59197 HIGH POC
8.2 Jul 14

Heap out-of-bounds write in Python Pillow prior to 12.3.0 lets an attacker who controls the rank-filter size parameter c

CVE-2026-59200 HIGH POC
7.5 Jul 14

Uncontrolled memory consumption in Python Pillow (PIL) versions 5.1.0 through 12.2.x allows a remote attacker to cause d

CVE-2021-23437 HIGH POC
7.5 Sep 03

The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb

CVE-2025-48379 HIGH POC
7.1 Jul 01

Pillow is a Python imaging library. In versions 11.2.0 to before 11.3.0, there is a heap buffer overflow when writing a

CVE-2016-4009 CRITICAL
9.8 Apr 13

Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote

CVE-2014-3007 CRITICAL
10.0 Apr 27

Python Image Library (PIL) 1.1.7 and earlier and Pillow 2.3 might allow remote attackers to execute arbitrary commands v

CVE-2026-96639 CRITICAL
9.8 Oct 21

Pillow versions 11.0.0 through 12.x (fixed in 13.0.0) can reuse a stale native ImagingCore buffer when a multi-frame ima

CVE-2021-34552 CRITICAL
9.8 Jul 13

Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7 allow an attacker to pass controlled parameters

CVE-2021-25289 CRITICAL
9.8 Mar 19

An issue was discovered in Pillow before 8.1.1. Rated critical severity (CVSS 9.8), this vulnerability is remotely explo

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy