Pillow has an OOB Write with Invalid PSD Tile Extents (Integer Overflow)
Published 4 May 2026 · Updated 10 Sept 2026
Is your project on an affected pillow?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- >=10.3.0 <12.2.0
- Fixed in
- 12.2.0
pip install 'pillow>=12.2.0'Details
Impact
Processing a malicious PSD file could lead to memory corruption, potentially resulting in a crash or arbitrary code execution.
Patches
Patched version: 12.2.0
Pillow 12.1.1 addressed CVE-2026-25990 by adding checks for tile extents in PSD image decoding/encoding to prevent an out-of-bounds write. However, the bounds checks computed tile extent sums using types susceptible to integer overflow, meaning a PSD image with carefully chosen tile dimensions could produce values that wrap around and bypass the checks, still triggering an out-of-bounds write in src/decode.c and src/encode.c. The fix avoids adding extents together before comparison.
Workarounds
Use any version but affected versions: >= 10.3.0, < 12.2.0
Resources
- Fix: https://github.com/python-pillow/Pillow/pull/9520
- Original issue: CVE-2026-25990 (Pillow 12.1.1)
Is GHSA-pwv6-vv43-88gr in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected pillow, and gives you the command that fixes it.
More advisories for pillow
- MediumCVE-2026-128066Pillow: Memory DoS in TIFF and EXIF IFD parsing via overlapping tag data · 12 Nov 2026
- HighCVE-2026-128067Pillow: Heap buffer overflow saving TIFF with libtiff when tags override image size · 12 Nov 2026
- CriticalCVE-2026-112398Pillow: Heap buffer overflow in FlashPix (FPX) JPEG decoding leads to code execution · 23 Oct 2026
- MediumCVE-2026-114501Pillow: Arrow export leaks stale heap memory when PILLOW_ALIGNMENT > 1 · 23 Oct 2026
- HighGHSA-78g4-xqwv-q3g8Pillow: Bundled libopenjp2 2.5.4 in all wheels since 11.1.0 carries OSV-2025-219 heap-buffer-overflow write reachable from Image.open().load() · 22 Oct 2026
- HighCVE-2026-96778Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer · 22 Oct 2026
References
- Linkgithub.com/python-pillow/Pillow/security/advisories/GHSA-cfh3-3jmp-rvhc
- Linkgithub.com/python-pillow/Pillow/security/advisories/GHSA-pwv6-vv43-88gr
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-42311
- Linkgithub.com/python-pillow/Pillow/pull/9520
- Linkgithub.com/python-pillow/Pillow/commit/58f9a1d166dcb0c274807d4423522d205b0c35ea
- Packagegithub.com/python-pillow/Pillow
- Linkgithub.com/python-pillow/Pillow/releases/tag/12.2.0
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.