CVE-2025-48379:
Pillow vulnerability can cause write buffer overflow on BCn encoding
7.1
CVSS ScoreBasic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
pillow | pip | >= 11.2.0, < 11.3.0 | 11.3.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability described is a heap buffer overflow in the DDS image format encoder in the Pillow library. The analysis of the provided pull request, specifically commit 466d228135cc645b881118b45aa11c868b192f48
and 8cd86b63626259d70b50545fabb554924ed3bd8a
, points directly to the ImagingBcnEncode
function in src/libImaging/BcnEncode.c
. The patches introduce a bounds check within a loop in this function. The absence of this check in the vulnerable versions is the root cause of the buffer overflow. When a large image is being saved in DDS format, this function is called to encode the image data. The loop processes the image data in chunks, and without the size check, it would continue writing to the buffer even if it has been filled, thus overflowing it. The vulnerable function is therefore ImagingBcnEncode
, and any runtime profile during the exploitation of this vulnerability would show this function in the stack trace.
Vulnerable functions
ImagingBcnEncode
src/libImaging/BcnEncode.c