Impact
A heap buffer overflow in Pillow occurs when the library processes a JPEG image that contains an ICC profile that exactly fills the 65536‑byte encoder buffer while also appending a JPEG COM comment. The internal libjpeg routine writes one byte before verifying that the free space counter has not been exhausted, allowing the attacker‑controlled comment and following image data to overwrite adjacent heap memory. Overwrite can lead to a crash and, in certain memory layouts, the potential to execute arbitrary code.
Affected Systems
The vulnerability affects the Pillow image library, version 9.4.0 through 13.0.0. Applications that use any of these releases to re‑save or re‑encode JPEG images created by untrusted sources are at risk.
Risk and Exploitability
The CVSS score of 7.7 indicates moderate severity. Although the EPSS score is not available and the flaw is not listed in the CISA KEV, the attack requires that the application re‑encode an image with a specific ICC profile and comment. This is likely in web or desktop applications that allow user image uploads. Crash is guaranteed; code execution is possible only with a suitable heap layout, so the risk is less certain but significant enough to warrant immediate attention.
OpenCVE Enrichment
Github GHSA