Pillow: Quadratic GIF comment copying during save
On Pillow 12.3.0 and upstream main (ad277e2761b489681e71b51e91367d46b0ceabb9), a GIF with a long comment causes _get_global_header() to copy portions of the comment repeatedly when saving, including comments carried over from untrusted images. This can lead to a crafted-image CPU denial of service with provisional Moderate severity and CVSS-B 6.9, assuming a network service automatically opens unauthenticated uploads and they are resaved as GIFs. Impact depends on input size, concurrency, and worker CPU limits.
What to do
Upgrade pillow to version 13.0.0 or later.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | pillow | >= 9.2.0, < 13.0.0 | 13.0.0 |
References
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-fc9g-5qg7-mf45
- https://nvd.nist.gov/vuln/detail/CVE-2026-112891
- https://github.com/python-pillow/Pillow/commit/68a3fe957d8a4d552e8c69d96066d749f0614c7e
- https://github.com/python-pillow/Pillow
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N- Weakness (CWE)
CWE-407- Platform
- Python (PyPI)
- Package
pillow- Disclosed
- 21.10.2026
- Updated
- 22.10.2026 10:00
Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.
OSV / GitHub Advisory Database - GHSA-fc9g-5qg7-mf45 - CC BY 4.0
Vulnerability history: pillow
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 89
- First → latest
- 04.2014 10.2026
- Without a fix
- 0
- Exploited in attacks
- 1
Severity breakdown
- Critical 12
- High 57
- Medium 18
- Low 1
- Unrated 1
Disclosures per year
- 2017: 1
- 2018: 0
- 2019: 1
- 2020: 10
- 2021: 20
- 2022: 8
- 2023: 3
- 2024: 2
- 2025: 1
- 2026: 31
earlier: 12
-
Pillow: Quadratic GIF comment copying during save this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.