CVE-2026-55798: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in python-pillow Pillow
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.
AI Analysis
Technical Summary
The vulnerability in python-pillow Pillow (CVE-2026-55798) involves improper neutralization of special elements in OS commands (CWE-78). Specifically, the WindowsViewer.get_command() function prior to version 12.3.0 embeds a file path directly into a cmd.exe shell command string without escaping special characters. This command string is executed with subprocess.Popen using shell=True, enabling an attacker to inject arbitrary commands through crafted file paths containing shell metacharacters. The vulnerability is resolved in Pillow version 12.3.0 by properly handling or escaping the file path before command execution.
Potential Impact
An attacker who can control or influence the file path passed to WindowsViewer.get_command() may execute arbitrary commands on the host system with the privileges of the process running Pillow. The CVSS score of 4.5 (medium) reflects limited attack vector (local), high attack complexity, no privileges required, and user interaction required. Confidentiality, integrity, and availability impacts are rated low but present.
Mitigation Recommendations
Upgrade to Pillow version 12.3.0 or later, where this vulnerability is fixed. No other official remediation or temporary fixes are documented. Users should avoid using vulnerable versions and ensure that file paths passed to WindowsViewer.get_command() are from trusted sources.
CVE-2026-55798: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in python-pillow Pillow
Description
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.
CVSS v3.1
Score 4.5medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in python-pillow Pillow (CVE-2026-55798) involves improper neutralization of special elements in OS commands (CWE-78). Specifically, the WindowsViewer.get_command() function prior to version 12.3.0 embeds a file path directly into a cmd.exe shell command string without escaping special characters. This command string is executed with subprocess.Popen using shell=True, enabling an attacker to inject arbitrary commands through crafted file paths containing shell metacharacters. The vulnerability is resolved in Pillow version 12.3.0 by properly handling or escaping the file path before command execution.
Potential Impact
An attacker who can control or influence the file path passed to WindowsViewer.get_command() may execute arbitrary commands on the host system with the privileges of the process running Pillow. The CVSS score of 4.5 (medium) reflects limited attack vector (local), high attack complexity, no privileges required, and user interaction required. Confidentiality, integrity, and availability impacts are rated low but present.
Mitigation Recommendations
Upgrade to Pillow version 12.3.0 or later, where this vulnerability is fixed. No other official remediation or temporary fixes are documented. Users should avoid using vulnerable versions and ensure that file paths passed to WindowsViewer.get_command() are from trusted sources.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-17T14:40:28.381Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a4bfce927e9c7971910b4ca
Added to database: 07/06/2026, 19:07:21 UTC
Last enriched: 07/14/2026, 08:56:30 UTC
Last updated: 08/20/2026, 10:52:10 UTC
Views: 125
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.