Skip to content
Wednesday, October 21, 2026AboutContactRSS
Pillow 13.0.0 Released to Patch CVE-2026-112403 Critical Memory Write in JPEG
Vulnerabilities

Pillow 13.0.0 Released to Patch CVE-2026-112403 Critical Memory Write in JPEG

The Python imaging library releases version 13.0.0 to fix CVE-2026-112403, a critical flaw allowing arbitrary memory writes via specific JPEG files.

Key points

  • Pillow versions through 12.3.0 are vulnerable to a critical heap overflow.
  • Version 13.0.0 is available and fixes the issue with CVE-2026-112403.
  • The flaw affects lossless JPEG processing and allows arbitrary memory writes.

Pillow version 13.0.0 addresses a critical security flaw in the library’s handling of lossless JPEG images. The vulnerability, tracked as CVE-2026-112403, allows an attacker to perform arbitrary memory writes by supplying a specially crafted image file.

What happened

The flaw exists in how Pillow processes JPEG scaling requests. When the `Image.thumbnail()` method runs, it calls `JpegImageFile.draft()` to request scaled output. This function shrinks the expected image dimensions and allocates a decode buffer sized for that smaller scale. However, libjpeg-turbo version 3.x handles lossless JPEG streams differently. It ignores scaling requests for lossless data and returns full-width rows instead.

According to the GitHub advisory GHSA-8g5g-8vmr-9782, the decoder writes these full-width rows into the smaller buffer. Each scanline write exceeds the allocated heap space. The overflowing bytes contain the decoded pixel values. This results in a heap overflow that can lead to arbitrary memory writes. The input file is a standards-compliant JPEG using the SOF3 marker.

Why it matters

This vulnerability is rated critical. It allows attackers to write arbitrary memory contents. The exploit works with standard JPEG files that include lossless spatial coding. Pillow’s Python parser accepts the SOF3 marker normally. This means standard format checks do not prevent the attack. Any system using Pillow to open user-supplied JPEG images may be at risk.

What to watch

  • Monitor for new Pillow releases beyond version 13.0.0.
  • Check internal logs for crashes or unexpected behavior in image processing services.
  • Review applications that accept JPEG uploads for potential exposure.

Who needs to act first

Teams should prioritize updating systems that process untrusted image uploads. Exposed web applications and image resizing services require immediate attention. Deploy the fix in a staging environment first to verify compatibility. Back up current configurations before making changes. If immediate patching is not possible, restrict input formats to exclude lossless JPEGs where feasible. Coordinate with development teams to test dependent applications thoroughly.

What to do and how to stay safe: Pillow

  • Update Pillow to version 13.0.0 or later on all affected systems.
  • Audit applications that accept JPEG files for potential exposure to this flaw.
  • Implement input validation to reject unexpected JPEG markers if possible.
  • Monitor vendor advisories for additional security updates or guidance.

Step-by-step guide: Virtual Patching Myths: What It Actually Fixes and Breaks

General security guidance from the Patch Gazette newsroom. It is not confirmed advice from the organisations named in this story.

Frequently asked questions

Which Pillow versions are affected by CVE-2026-112403?

All versions up to and including 12.3.0 are vulnerable.

Is there a fix available for this vulnerability?

Yes, version 13.0.0 patches the issue.

Does this affect all JPEG files?

No, it specifically affects lossless JPEG files using the SOF3 marker.

Sources

  1. GitHub Advisory Database

Related stories