CVE-2025-48379: Pillow Pillow Vulnerability Can Cause Write Vulnerability

HIGH
Advisory Identifier: GHSA-xg8h-j46f-w952
CVSS 7.1
CWE-122
Published
Advisory Summary

CVE-2025-48379 is a HIGH (CVSS 7.1) pillow vulnerability can cause write vulnerability (CWE-122: Heap-based Buffer Overflow) affecting Pillow libraries in the PyPI ecosystem. The issue involves pillow vulnerability can cause write buffer overflow on bcn encoding. Remediation is available by upgrading affected packages to version 11.3.0.

CVE-2025-48379 at a Glance

CVE Identifier CVE-2025-48379
GHSA Identifier GHSA-xg8h-j46f-w952
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-122: Heap-based Buffer Overflow
Affected Product Pillow
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-48379

To remediate this vulnerability, upgrade all affected Pillow dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pillow fixed: 11.3.0
pip install pillow>=11.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pillow

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-48379, inspect your installed packages using pip:

pip show pillow

Analyze the terminal output to locate any version of Pillow in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.3.0), your application is affected.

Note: The pip show pillow command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-122: Heap-based Buffer Overflow, where a heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). In Pillow, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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. * Unclear how large the potential write could be. It is likely limited by process segfault, so it's not necessarily deterministic. It may be practically unbounded. * Unclear if there's a restriction on the bytes that could be emitted. It's likely that the only restriction is that the bytes would be emitted in chunks of 8 or 16. This was introduced in Pillow 11.2.0 when the feature was added.

CVE-2025-48379 Affected Pillow Versions

1 component(s)
Fixed Versions:
11.3.0
Product / Package Ecosystem Affected Versions Fixed Version
pillow
PyPI
≥ 11.2.0
< 11.3.0
11.3.0

References

Frequently Asked Questions

What is CVE-2025-48379?
CVE-2025-48379 is a security vulnerability in Pillow involving Pillow vulnerability can cause write buffer overflow on BCn encoding under CWE-122: Heap-based Buffer Overflow.
Which Pillow versions are affected?
Affected versions include releases prior to 11.3.0 across affected packages: pillow.
What version fixes CVE-2025-48379?
Upgrading to 11.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pillow affected?
Yes, pillow is affected in releases prior to 11.3.0. Upgrade your dependency to 11.3.0 or later.
What is the CVSS score of CVE-2025-48379?
CVE-2025-48379 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H.
What CWE is associated with CVE-2025-48379?
CVE-2025-48379 is classified under CWE-122: Heap-based Buffer Overflow (A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().).
How can I check PyPI dependencies for CVE-2025-48379?
Run the dependency tree command: 'pip show pillow'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xg8h-j46f-w952",
  "modified" : "2025-07-02T14:20:24Z",
  "published" : "2025-07-01T17:29:37Z",
  "aliases" : [ "CVE-2025-48379" ],
  "summary" : "Pillow vulnerability can cause write buffer overflow on BCn encoding",
  "details" : "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. \n\nThis only affects users who save untrusted data as a compressed DDS image. \n\n* Unclear how large the potential write could be. It is likely limited by process segfault, so it's not necessarily deterministic. It may be practically unbounded. \n* Unclear if there's a restriction on the bytes that could be emitted. It's likely that the only restriction is that the bytes would be emitted in chunks of 8 or 16. \n\nThis was introduced in Pillow 11.2.0 when the feature was added.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pillow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.2.0"
      }, {
        "fixed" : "11.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/security/advisories/GHSA-xg8h-j46f-w952"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-48379"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/pull/9041"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/commit/ef98b3510e3e4f14b547762764813d7e5ca3c5a4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2025-61.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/python-pillow/Pillow"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/releases/tag/11.3.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-122" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-07-01T17:29:37Z",
    "nvd_published_at" : "2025-07-01T19:15:27Z"
  }
}