cve.bz

CVE-2026-55798 python pillow: OS Command Injection

4.5 mediumExploit referenceEPSS 0.2%Fix available

Medium (4.5) in python pillow. EPSS 0.2% estimated probability of exploitation activity in the next 30 days. Fixed in pillow 12.3.0.

On this page
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.

Severity

CVSS 3.1

4.5 medium
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
EPSS
0.2% (unchanged from 0.2% a week ago; 0.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 8th percentile. Scored 2026-11-17. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: partial, assessed 2026-07-07. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-78 Improper Neutralization of Special Elements used in an OS Command (OS Command Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-55798 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-55798?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-55798?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-55798 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
python:pillowbefore 12.3.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-4x4j-2g7c-83w6PyPIpillow<12.3.012.3.0
PYSEC-2026-2257PyPIpillow<12.3.012.3.0

Red Hat

Red Hat rates this Moderate.

Red Hat's 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.

Red Hat's mitigation

This vulnerability is specific to the WindowsViewer class in Pillow, which is only invoked on Windows systems. Red Hat products ship and run on Linux, where the UnixViewer class is used instead, which properly applies shlex.quote() to file paths. The vulnerable Windows code path is not reachable on Red Hat's supported platforms. Users can upgrade to Pillow 12.3.0 or later, which adds proper escaping to the Windows code path.

ProductPackageStateAdvisory
Exploit Intelligenceexploit-intelligence-tech-preview/vulnerability-analysis-rhel9Not affected
Lightspeed Corelightspeed-core/lightspeed-stack-rhel9Not affected
OpenShift Lightspeedopenshift-lightspeed/lightspeed-ocp-rag-rhel9Not affected
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Not affected
OpenShift Lightspeedopenshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9Not affected
Red Hat AI Inference Serverrhaii/model-opt-cuda-rhel9Not affected
Red Hat AI Inference Serverrhaiis/model-opt-cuda-rhel9Not affected
Red Hat AI Inference Serverrhaiis/vllm-cpu-rhel9Not affected
Red Hat AI Inference Serverrhaiis/vllm-cuda-rhel9Not affected
Red Hat AI Inference Serverrhaiis/vllm-neuron-rhel9Not affected
Red Hat AI Inference Serverrhaiis/vllm-rocm-rhel9Not affected
Red Hat AI Inference Serverrhaiis/vllm-spyre-rhel9Not affected
Red Hat AI Inference Serverrhaiis/vllm-tpu-rhel9Not affected
Red Hat AI Inference Serverrhaii/vllm-cpu-rhel9Not affected
Red Hat AI Inference Serverrhaii/vllm-cuda-rhel9Not affected
Red Hat AI Inference Serverrhaii/vllm-gaudi-rhel9Not affected
Red Hat AI Inference Serverrhaii/vllm-neuron-rhel9Not affected
Red Hat AI Inference Serverrhaii/vllm-rocm-rhel9Not affected
Red Hat AI Inference Serverrhaii/vllm-spyre-rhel9Not affected
Red Hat AI Inference Serverrhaii/vllm-tpu-rhel9Not affected
59 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-55798.

Attack patterns (CAPEC)

  • CAPEC-6 Argument Injection Likelihood: High · Severity: High
  • CAPEC-15 Command Delimiters Likelihood: High · Severity: High
  • CAPEC-43 Exploiting Multiple Input Interpretation Layers Likelihood: Medium · Severity: High
  • CAPEC-88 OS Command Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON