CVE-2025-48379
NoneCVSS
—
EPSS
0.3%
Published
Jul 1, 2025
CISA due date
—
Cloudanix analysis
A bug in a popular Python image library can let attackers crash programs or potentially take control when the software tries to save certain large image files.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Data Tampering
- Component
- Library
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap buffer overflow when writing a sufficiently large compressed DDS image due to lack of bounds checking before writing into the output buffer.
Why it matters to the business
Applications that save untrusted image data as compressed DDS files may crash or allow arbitrary code execution, disrupting image-processing workflows and exposing systems that handle user-supplied graphics.
How an attack unfolds
An attacker supplies a large DDS image file; when the vulnerable Pillow library writes it in compressed DDS format, the missing size check causes a write past the allocated buffer, potentially corrupting heap memory for code execution.
How to fix it
Upgrade python-pillow/pillow to version 11.3.0 or apply commit 89f1f4626a2aaf5f3d5ca6437f41def2998fbe09. Avoid saving untrusted data as compressed DDS until patched.
How to confirm the fix worked
Confirm Pillow version is 11.3.0 or newer; attempt to save a >64 kB compressed DDS image and verify no crash or overflow occurs.
Typical attack path
- Craft or obtain a DDS image exceeding 64 kB when compressed with default settings
- Cause the target application to call Pillow's DDS save routine on the untrusted image
- Trigger the unchecked buffer write that overflows the heap allocation
- Leverage the resulting memory corruption to execute arbitrary code or crash the process
How to detect it
Review application logs for unexpected crashes or segmentation faults during DDS save operations; inspect heap-related error messages or memory corruption indicators in crash dumps from processes using Pillow.
What your security team should do
- Immediately upgrade all Pillow installations to 11.3.0
- Restrict or sanitize untrusted image inputs before DDS compression
- Monitor for crashes in image-processing services that accept DDS files
- Review downstream dependencies that rely on Pillow for DDS handling
The record
Pillow is a Python imaging library. In versions 11.2.0 to before 11.3.0, there is a heap buffer overflow when writing a sufficiently large (>64k encoded with default settings) image in the DDS format due to writing into a buffer without checking for available space. This only affects users who save untrusted data as a compressed DDS image. This issue has been patched in version 11.3.0.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | pillow | 0 | 89f1f4626a2aaf5f3d5ca6437f41def2998fbe09 |
| PyPI | pillow | 11.2.0 | 11.3.0 |
| Bitnami | pillow | 11.2.0 | No fix |
| Chainguard | kubeflow-pipelines-visualization-server | 0 | 2.5.0-r4 |
| Chainguard | open-webui | 0 | 0.6.36-r0 |
| Chainguard | open-webui-compat | 0 | 0.6.36-r0 |
| Chainguard | pgadmin4 | 0 | 9.5-r0 |
| Chainguard | pgadmin4-oci-entrypoint | 0 | 9.5-r0 |
| Chainguard | pgadmin4-pg12 | 0 | 9.5-r0 |
| Chainguard | pgadmin4-pg13 | 0 | 9.5-r0 |
| Chainguard | pgadmin4-pg14 | 0 | 9.5-r0 |
| Chainguard | pgadmin4-pg15 | 0 | 9.5-r0 |
| Chainguard | pgadmin4-pg16 | 0 | 9.5-r0 |
| Chainguard | pgadmin4-pg17 | 0 | 9.5-r0 |
| Chainguard | py3-vllm-cuda-12.4 | 0 | 0.9.2-r0 |
| Chainguard | py3.10-torchvision-cuda-12.3 | 0 | 0.18.1-r7 |
| Chainguard | py3.10-vllm-cuda-11.8 | 0 | 0.9.1-r2 |
| Chainguard | py3.10-vllm-cuda-12.4 | 0 | 0.9.2-r0 |
| Chainguard | py3.10-wheels-torchvision-cuda-12.3 | 0 | 0.18.1-r7 |
| Chainguard | py3.10-wheels-vllm-cuda-11.8 | 0 | 0.9.1-r2 |
| Chainguard | py3.11-torchvision-cuda-12.3 | 0 | 0.18.1-r8 |
| Chainguard | py3.11-wheels-torchvision-cuda-12.3 | 0 | 0.18.1-r8 |
| Chainguard | py3.12-vllm-cuda-12.4 | 0 | 0.9.2-r0 |
| Chainguard | py3.9-torchvision-cuda-11.8 | 0 | 0.18.1-r4 |
| Chainguard | py3.9-wheels-torchvision-cuda-11.8 | 0 | 0.18.1-r4 |
| Chainguard | superset | 0 | 5.0.0-r0 |
| Chainguard | superset-ci | 0 | 5.0.0-r0 |
| Chainguard | superset-entrypoint | 0 | 5.0.0-r0 |
| Chainguard | superset-iamguarded-compat | 0 | 5.0.0-r0 |
| Chainguard | tensorflow-cpu-jupyter | 0 | 2.19.0-r6 |
| Chainguard | tensorflow-gpu-jupyter | 0 | 2.19.0-r5 |
| Chainguard | tritonserver-backend-vllm-24.04 | 0 | 24.04-r13 |
| Ubuntu:22.04:LTS | pillow | 0 | No fix |
| Ubuntu:24.04:LTS | pillow | 0 | No fix |
| Ubuntu:24.10 | pillow | 0 | No fix |
| Ubuntu:25.04 | pillow | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | pillow | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | pillow | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | pillow | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | pillow | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | pillow-python2 | 0 | No fix |
| Wolfi | kubeflow-pipelines-visualization-server | 0 | 2.5.0-r4 |
| Wolfi | open-webui | 0 | 0.6.36-r0 |
| Wolfi | open-webui-compat | 0 | 0.6.36-r0 |
| Wolfi | superset | 0 | 5.0.0-r0 |
| Wolfi | superset-ci | 0 | 5.0.0-r0 |
| Wolfi | superset-entrypoint | 0 | 5.0.0-r0 |
| Wolfi | superset-iamguarded-compat | 0 | 5.0.0-r0 |
| Wolfi | tensorflow-cpu-jupyter | 0 | 2.19.0-r6 |
| openSUSE:Tumbleweed | python-Pillow | 0 | 11.3.0-1.1 |
| pypi | Pillow | 11.2.0 | No fix |
Related vulnerabilities
- CVE-2026-25990 Pillow is a Python imaging library. Also affects pillow
- CVE-2024-28219 In _imagingcms.c in Pillow before 10.3.0, a buffer overflow exists because strcpy is used… Also affects pillow
- GHSA-4fx9-vc88-q2xc Infinite loop in Pillow Also affects pillow
- GHSA-jgpv-4h4c-xhw3 Uncontrolled Resource Consumption in pillow Also affects pillow
- CVE-2016-3076 Heap-based buffer overflow in the j2k_encode_entry function in Pillow 2.5.0 through 3.1.1… Also affects pillow
- CVE-2016-9190 Pillow before 3.3.2 allows context-dependent attackers to execute arbitrary code by using… Also affects pillow
- CVE-2016-9189 Pillow before 3.3.2 allows context-dependent attackers to obtain sensitive information by… Also affects pillow
- CVE-2016-4009 Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in… Also affects pillow