Impact
Pillow, the Python imaging library, performs quadratic copying of GIF comment data while assembling the global header in its save routine. From version 9.2.0 through 12.x, an attacker can craft a GIF with an unusually large comment. The library then repeatedly copies portions of this comment, causing the CPU workload to grow quadratically with the comment size. This unnecessary computation can severely degrade or halt an application that processes user supplied images, making the weakness a classic denial‑of‑service flaw identified as CWE‑407.
Affected Systems
The vulnerability affects the Pillow library bundled with the python‑pillow package. Any Python environment that imports Pillow and processes image files for users is potentially exposed on versions 9.2.0 up to but not including 13.0.0; the issue was resolved in Pillow 13.0.0. Applications that perform a resize, filter, or otherwise trigger a call to Pillow’s GIF save path are at risk if they accept untrusted image uploads.
Risk and Exploitability
The CVSS score of 6.9 indicates moderate severity, and the EPSS score of < 1% indicates a low likelihood of exploitation. The vulnerability is not listed in the CISA KEV catalog. An attacker can exploit the weakness by submitting a GIF image with a massive comment field to an application that will use Pillow to save or re‑encode the file. The resulting quadratic copy operation can monopolise CPU resources, potentially delaying or denying service for other requests.
OpenCVE Enrichment
Github GHSA