Pillow: four high-severity DoS/memory-safety flaws in PDF append, TarIO, PNG eXIf, and WMF/EMF rendering (CVE-2026-96640, CVE-2026-96642)
Severity: high · Patch status: patched · Since 2026-10-17 · CVE-2026-96640, CVE-2026-96642, CVE-2026-96643, CVE-2026-96644, CVE-2026-96778
Four high-severity advisories were published for Pillow on 2026-10-17/22, all fixed in 13.0.0. CVE-2026-96640: a malformed PDF /Pages tree with repeated child references makes PdfParser.linearizepagetree() expand duplicates exponentially, causing CPU resource exhaustion via Image.save(..., append=True) with attacker-supplied PDFs (affects =5.1.0). CVE-2026-96642: TarIO.TarIO() spins forever at 100% CPU on a crafted tar header with a negative size field. A third flaw makes EXIF parsing quadratic via repeated markers in PNG eXIf chunks (affects =11.0.0). A fourth, Windows-only, heap over-read in WMF/EMF rendering stems from 16-bit dimension truncation in display.c. All are denial-of-service or memory-safety issues reachable with small crafted files; no exploitation reported. Upgrade to Pillow 13.0.0.
What to do
- Upgrade Pillow to 13.0.0 across all environments and rebuild/redeploy dependent images
- Audit services that accept untrusted PDFs and use Pillow's PDF append path; restrict or sandbox until patched
- Identify apps calling PIL.TarIO.TarIO() directly on untrusted archives and remove or gate that path
- On Windows hosts, avoid processing untrusted WMF/EMF files with Pillow until upgraded
- Add or verify dependency-scanning rules for these CVEs in CI and pin >=13.0.0
Fixed versions
Sources
All live incidents on Threat Watch