CVE-2026-59198 Pillow TGA RLE encoder can serialize up to ~57 KB of adjacent heap data into generated images

Medium 6.5 Published Updated

An attacker can craft a specific image to cause Pillow to leak adjacent heap memory into the output file, potentially exposing sensitive data.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-59198?

CVE-2026-59198 is a medium-severity vulnerability in Python Pillow, published on 14 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Pillow is a Python imaging library. From 5.2.0 until 12.3.0, Pillow's TGA RLE encoder reads past its packed row buffer when saving a mode 1 image with TGA RLE compression, allowing adjacent process heap bytes to be copied into the generated TGA file. This issue is fixed in version 12.3.0.

Weakness: CWE-125

Which versions are affected by CVE-2026-59198?

4 open source packages ship an affected version, including pillow and Pillow. It affects 1 product.

PackageAffectedFixed in
pillow BitnamiFrom 5.2.012.3.0
pillow PyPIFrom 5.2.012.3.0
pillow PyPIFrom 5.2.012.3.0
Pillow PyPIFrom 5.2.012.3.0

Products include Python Pillow.

How do I fix CVE-2026-59198?

Upgrade pillow to 12.3.0 or later.

Is CVE-2026-59198 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-59198 exists.

All Python Pillow vulnerabilities

Sources

Also known as BIT-pillow-2026-59198, DEBIAN-CVE-2026-59198, ECHO-14ce-d866-ae2b, GHSA-fj7v-r99m-22gq, MINI-3886-fgr3-33h8, MINI-4v87-ppqg-8f77 and 13 more.

Is CVE-2026-59198 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free