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.

Created at: May 22, 2026Updated at: May 22, 2026

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.

Affected Package

Affecting pillow package, versions
>=11.2.1,<11.3.0

Also affects

---

How to Fix

Upgrade
pillow
to
11.3.0
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

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