Pillow: NULL pointer dereference in Image.merge()
Summary
Pillow, the Python imaging library, contains a NULL pointer dereference in Image.merge(). The function does not validate the first input band, so a crafted image can crash the native process. An attacker can trigger this by supplying a crafted IPTC file that an application opens and loads, or by reaching Image.merge() directly with a malicious first band. The impact is a denial of service (hard crash), not code execution or data disclosure.
Affected
- Pillow 12.0.0 to 12.3.0 (per GitHub advisory GHSA-cp9v-662q-vvx9)
- The CVE record describes the range as 12.0.0 until 13.0.0
Fixed in
- Pillow 13.0.0
Workaround
- Unknown. No vendor-documented workaround is available.
- A try/except block is unlikely to help, because a native segfault cannot be caught by Python exception handling.
- Isolating image processing in a separate worker process limits the impact of a crash.
Exploitation
- Public proof-of-concept exists (described in the GitHub advisory).
- CISA SSVC: Exploitation poc, automatable: yes, technical impact: partial.
- Known exploitation in the wild: Unknown. The CISA KEV catalogue was not checked.
Our recommendation
- Inventory Pillow versions across servers, containers and appliances, including transitive dependencies.
- Upgrade to Pillow 13.0.0 or later, and test image-handling code before rollout (Pillow 13 drops Python 3.10).
- If an immediate upgrade is not possible, restrict or isolate processing of untrusted images.
- Prioritise internet-facing upload features and document processing.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- GitHub Security Advisory GHSA-cp9v-662q-vvx9 github.com
- Pillow commit b6ee66e (fix) github.com
- Pillow 13.0.0 release github.com
- OSV GHSA-cp9v-662q-vvx9 osv.dev
- Ubuntu CVE-2026-112405 ubuntu.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 01:52.
Original description (NVD)
Pillow is a Python imaging library. From 12.0.0 until 13.0.0, Pillow's Image.merge() can dereference a null image8 plane. Validation skips the first input band, allowing a 32-bit integer or floating-point image backed by image32 storage to be merged as a narrower multiband image. A crafted IPTC file can reach this path when an application opens and loads it, or a caller can invoke Image.merge() directly with such a first band. This causes a native process crash. This issue is fixed in version 13.0.0.
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
