CVE-2026-96639: Pillow multi-frame loaders can reuse stale native image storage after mode transitions
Pillow multi-frame image loaders can retain native ImagingCore storage allocated for one frame while changing the Python-side image mode and decoder tiles for a later frame.
If frame 0 allocates storage for a narrow mode such as L, and a later frame of the same dimensions switches to a wider mode such as RGB or CMYK, Pillow may decode wider pixels into the stale narrow native buffer. This causes native
out-of-bounds writes and process crashes. In the MPO/JPEG path, I also demonstrated command execution in matching Python/Pillow runtime profiles through Pillow’s documented ImageSequence.Iterator + frame.load() path.
References
- github.com/advisories/GHSA-v9pv-5gc8-w2m6
- github.com/python-pillow/Pillow/commit/78d97d994579aef81aafe123773d525f40f2522a
- github.com/python-pillow/Pillow/pull/10105
- github.com/python-pillow/Pillow/releases/tag/13.0.0
- github.com/python-pillow/Pillow/security/advisories/GHSA-v9pv-5gc8-w2m6
- nvd.nist.gov/vuln/detail/CVE-2026-96639
Code Behaviors & Features
Detect and mitigate CVE-2026-96639 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →