Python apps that accept image uploads need Pillow 13. Two of its fixes stop code execution from a single file

By George Bailey   Published: 10/21/26   3 min read

Pillow is the image library behind a huge number of Python web apps: avatar uploads, thumbnails, document converters and media pipelines. Version 13.0.0, released October 16, fixes two bugs its maintainers rate critical.

Both can lead to code execution when an app opens a crafted image file. Pillow picks the decoder from the file’s contents, not its name, so renaming an upload to .jpg does not protect you.

If your Python app makes thumbnails from uploads, one crafted image can run code on that server until Pillow is on 13.0.0.

Pillow 13.0.0 fixes two image bugs that can run code

Pillow 13.0.0 came out on October 16 and its release notes list more than 40 security fixes. Two are rated critical. The first, CVE-2026-112398 (GHSA-5x8w-8jj5-q52h), is a heap overflow in FlashPix JPEG decoding; the advisory includes a proof of concept that runs a command when a single file is passed to Image.open(). It needs the optional olefile package to be installed.

The second (GHSA-v9pv-5gc8-w2m6) lets multi-frame formats such as MPO and PSD reuse an image buffer that is too small for a later frame. The researcher reports building a web upload demo where one unauthenticated request ran a command 10 out of 10 times on Pillow 12.3.0. GitHub’s advisory scores it 9.8.

Python services that open uploaded images

Any service that opens untrusted images with Pillow 12.3.0 or older is in scope. The FlashPix bug affects all versions up to 12.3.0; the multi-frame bug affects 11.0.0 through 12.3.0.

Pillow 13.0.0 drops support for Python 3.10, so apps still on 3.10 cannot take the fix without a Python upgrade.

Upgrade Pillow, or limit which formats your app will open

Forward this

For our developers: Pillow, the Python image library, has two critical fixes in version 13.0.0. Can we upgrade any service that handles uploaded images this week?

Details

Hunt / verify

Source: Pillow 13.0.0 release notes; CVE.org: CVE-2026-112398

Sources

George Bailey

George Bailey is the byline of the CyberExperts editorial desk, the team behind the CyberExperts Daily Brief. The desk covers vulnerabilities, breaches and security news from vendor advisories, CISA alerts and other primary sources, and links those sources in every story. Questions or corrections: [email protected].