Return to Threats

Critical Flaw in Python’s Popular Pillow Image Library Allows Code Execution via a Crafted Image

thehackernews.com 2026-10-23 AI supply chain Critical

Executive Summary

A flaw in Python’s Pillow image library can enable operating system command execution through a crafted EPS image and an unchecked filename passed to Ghostscript. Teams operating AI agents or LLM applications that process images should identify and review affected dependencies.

What Happened

Pillow, the most widely used image library for Python, can be made to run operating system commands on a server by specifying the name of a file it is told to open. The flaw, CVE-2026-112900, is in the way Pillow handles EPS images, which it opens by passing the file's name to Ghostscript, a separate program it runs to turn the image into pixels, without checking the name first.

Affected Products

  • Pillow
  • Ghostscript
  • Python

Vulnerability / Attack Technique

Command execution via crafted image and unsafe filename handling

Technical Mechanism

Pillow handles EPS images by passing the name of the file it is told to open to Ghostscript, which converts the image into pixels. The article states that Pillow does not check the filename first, allowing the filename to cause operating system commands to run on the server.

AI Security Category

LLM03:2025 Supply Chain

Part of the AI Supply Chain and AI SBOM topic.

Relevant Frameworks

LLM03:2025 Supply ChainMITRE ATLAS: Execution

RealGround Analysis

This matters to teams running AI agents or LLM applications when those systems rely on image-processing libraries to handle user-supplied or externally sourced content. A vulnerable dependency could expand an AI application’s attack surface even when the model itself is not involved; dependency inventory and security readiness reviews can help identify this exposure.

Recommended Controls

  • Inventory Pillow, Ghostscript, and image-processing dependencies used by AI agents and LLM applications.
  • Update or remediate affected Pillow deployments according to the vendor’s security guidance.
  • Restrict AI application image-processing components from executing operating system commands where feasible.
  • Treat externally supplied images and filenames as untrusted input and validate them before processing.
  • Isolate image conversion workloads with least-privilege permissions and sandboxing.

Related RealGround Service

AI Agent SBOM and LLM Mapping · or start with the free AI Agent Security Scanner.

Sources

thehackernews.com: https://thehackernews.com/2026/10/critical-flaw-in-pythons-popular-pillow.html

Summary and analysis written by RealGround from the source above; last updated 2026-10-24.

Talk to AI CISO