PyPI: pillow
CVE-2025-48379
Safety vulnerability ID: SFTY-20250702-34110
Safety legacy ID: pyup.io-77942
Affected versions of this package are vulnerable to a Buffer Overflow when saving sufficiently large compressed DDS images (>64KB with default settings). The DDS encoding functionality fails to perform bounds checking when writing to the destination buffer, leading to a heap buffer overflow condition. This vulnerability was introduced in Pillow 11.2.0 when BCn compression support for DDS format was added.
Overview
Pillow vulnerability can cause write buffer overflow on BCn encoding
Advisory
Affected versions of this package are vulnerable to a Buffer Overflow when saving sufficiently large compressed DDS images (>64KB with default settings). The DDS encoding functionality fails to perform bounds checking when writing to the destination buffer, leading to a heap buffer overflow condition. This vulnerability was introduced in Pillow 11.2.0 when BCn compression support for DDS format was added.
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20250702-34110/CVE-2025-48379
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-48379
- https://github.com/python-pillow/Pillow/commit/ef98b3510e3e4f14b547762764813d7e5ca3c5a4
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-xg8h-j46f-w952
- https://github.com/python-pillow/Pillow/pull/9041
- https://github.com/python-pillow/Pillow/releases/tag/11.3.0
- https://nvd.nist.gov/vuln/detail/CVE-2025-48379
- https://github.com/python-pillow/Pillow/commit/ef98b3510e3e4f14b547762764813d7e5ca3c5a4
- https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2025-61.yaml
- https://github.com/advisories/GHSA-xg8h-j46f-w952
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
