CVE-2026-55798·Python vulnerability
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
- medium
- Software
- Python
- Fixed in
- 12.3.0
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.14% — higher than 3% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
Until: 12.3.0
Fixed in: 12.3.0
How to fix this CVE
Update Pillow to version 12.3.0 or later to patch a command injection vulnerability in the WindowsViewer component. The vulnerability allows attackers to execute arbitrary commands through specially crafted file paths when image files are opened on Windows systems. Immediately apply this update to all systems running Pillow, particularly those that process user-supplied image files or expose image viewing functionality.
sudo dnf update python3-pillowDefensia detects this vulnerability
How to check if you are affected
- Check installed Pillow version: python3 -c "import PIL; print(PIL.__version__)"
- Verify if Pillow is installed as a package: pip3 show Pillow | grep Version
- Identify processes using Pillow image viewers: ps aux | grep -i viewer or lsof | grep -i PIL
- Confirm the patch by running: python3 -c "import PIL; print(PIL.__version__)" and verify it shows 12.3.0 or later
FAQ
What is CVE-2026-55798?
This is a command injection vulnerability in Pillow's WindowsViewer component where unescaped file paths are directly embedded into shell commands, allowing attackers to inject arbitrary Windows commands through crafted image file paths.
Is CVE-2026-55798 being actively exploited?
No, there is no evidence of active exploitation in the wild, and no public exploit code is currently available. However, the vulnerability has a straightforward exploitation path and should be patched immediately as a preventive measure.
What versions of Python are affected by CVE-2026-55798?
This affects Pillow versions prior to 12.3.0. The vulnerability is independent of the Python version itself but impacts any environment running the vulnerable Pillow library on Windows systems.
How do I check if my server is vulnerable to CVE-2026-55798?
Run 'python3 -c "import PIL; print(PIL.__version__)"' and if the version is below 12.3.0, your system is vulnerable. Additionally, check if Pillow is actively used in your applications with 'pip3 show Pillow'.
Does Defensia detect CVE-2026-55798?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Pillow is installed on a monitored server, CVE-2026-55798 will appear in your dashboard with remediation steps.
Related Python CVEs
References
- https://github.com/python-pillow/Pillow/blob/main/docs/releasenotes/12.3.0.rst
- https://github.com/python-pillow/Pillow/commit/8404ea5fe5df40fc34aa1e51403dd6fce0778b8a
- https://github.com/python-pillow/Pillow/commit/88194166691b7b603529b8b036ab3ab9cedd2de4
- https://github.com/python-pillow/Pillow/commit/b0e06caa64c1405aa3da0bb1d2bd9a77ca22de7f
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-4x4j-2g7c-83w6
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-55798. Free for 1 server.
Get started free