Pillow: Heap buffer overflow in ImagingJpegDecode (Critical severity, CVE-2026-112403)
A critical-severity advisory for the pip package Pillow is fixed in version 13.0.0.

Key points
- Pillow (pip) has a critical flaw.
- Tracked as CVE-2026-112403.
- Version 13.0.0.
Maintainers of Pillow, a package in the pip ecosystem, have published a critical-severity security advisory (CVE-2026-112403): Pillow: Heap buffer overflow in ImagingJpegDecode.
At a glance
- Advisory
- GHSA-8g5g-8vmr-9782
- CVE
- CVE-2026-112403
- Package
- Pillow (pip)
- Severity
- Critical
- Patched in
- 13.0.0
What is the issue?
The GitHub-reviewed advisory explains: Summary JpegImageFile.draft() — which Image.thumbnail() calls automatically — requests 1/2, 1/4 or 1/8 scaled JPEG output and shrinks self._size and the tile extents to match, so _setimage() allocates a single-row decode buffer of ceil(W/s) samples. ImagingJpegDecode() sets cinfo.scale_num/scale_denom, calls jpeg_start_decompress(), and then reads scanlines into that buffer without ever comparing cinfo.output_width, cinfo.output_height or cinfo.out_color_components against state-xsize, state-ysize and state-bits. libjpeg-turbo 3.x decodes lossless (SOF3) JPEG, but hardwires lossless streams to no scaling — the requested scale_denom is silently discarded. It therefore returns full-width W-sample rows into a buffer sized for ceil(W/s). Each jpeg_read_scanlines() call writes (W - ceil(W/s)) x components bytes past the end of the heap allocation, and the overflowing bytes are the decoded pix
Affected versions
| Ecosystem | Package | Vulnerable | Patched |
|---|---|---|---|
| pip | Pillow | <= 12.3.0 | 13.0.0 |
How to fix it
- Upgrade the affected package to the first patched version listed above.
- Rebuild and redeploy applications that bundle the vulnerable dependency.
- Run your dependency scanner (npm audit, pip-audit, Dependabot) to find transitive uses.
- Review the advisory references for workaround details if you cannot upgrade yet.
What to do and how to stay safe: CVE-2026-112403
- Vulnerability severity scores ignore your specific architecture and context.
- Exploitability depends on network exposure and user behavior, not just code flaws.
- Prioritization requires continuous asset inventory and threat intelligence alignment.
Risk-based vulnerability management focuses your limited resources on the flaws that actually threaten your business. Start by mapping your critical assets and checking for active exploits to prioritize your backlog.
Step-by-step guide: Risk-Based Vulnerability Management: Prioritize Fixes by Actual Danger
General security guidance from the Threat Times newsroom. It is not confirmed advice from the organisations named in this story.
Frequently asked questions
What is CVE-2026-112403?
CVE-2026-112403 is a security vulnerability in Pillow (pip).
Which version fixes CVE-2026-112403?
The fix is in version 13.0.0.


