RC RANDOM CHAOS

Pillow Image Library Patches Critical Code Execution Flaws

· via The Hacker News

Original source

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

The Hacker News →

Pillow, Python’s dominant image library with 436 million monthly downloads, contains a critical code execution vulnerability that lets attackers run arbitrary commands on servers processing user-supplied files. CVE-2026-112900 affects EPS image handling—Pillow passes filenames directly to Ghostscript, a separate image conversion tool, without validation. Attackers can craft filenames that Ghostscript interprets as shell commands rather than file paths, achieving remote code execution. The vulnerability spans Pillow 2.6.0 through 12.3.0 and requires Ghostscript to be installed. The attack is practical for web applications that preserve or construct filenames from user input during upload processing.

Pillow 13.0.0, released October 16, patches the EPS vulnerability and addresses several additional critical flaws. Although maintainers rated the EPS flaw as moderate, GitHub’s CVE record scores it 9.2. The release also fixes a memory corruption bug involving stale image data after mode changes, and two JPEG buffer overflows. One JPEG overflow affects FlashPix files and triggers from a single Image.open() call if the optional olefile package is installed. The other, CVE-2026-112403, occurs when creating thumbnails from malformed JPEG files; Anthropic discovered this vulnerability using Claude for automated security analysis and Ada Logics validated it manually. A separate flaw, CVE-2026-112393, has existed since 2013 and corrupts memory when saving compressed TIFF images to in-memory buffers, though disk writes are unaffected.

Users should upgrade to Pillow 13.0.0 immediately; those on Python 3.10 must upgrade to 3.11 or later, as version 13 drops 3.10 support. For systems unable to patch immediately, Pillow recommends removing Ghostscript from production servers handling untrusted files, avoiding thumbnail operations on untrusted JPEGs, and treating in-memory TIFF saves as security-sensitive operations. No active exploitation of the EPS vulnerability has been reported, though a public proof-of-concept exists for the TIFF flaw.

Read the full article

Continue reading at The Hacker News →

This is an AI-generated summary. Read the original for the full story.