CVE-2020-10378: Pillow Out-of-bounds Read Vulnerability

HIGH
Advisory Identifier: GHSA-3xv8-3j54-hgrp
CVSS 5.5
CWE-125
Published
Advisory Summary

CVE-2020-10378 is a HIGH (CVSS 5.5) out-of-bounds read vulnerability (CWE-125: Out-of-bounds Read) affecting Pillow libraries in the PyPI ecosystem. The issue involves out-of-bounds read in pillow. Remediation is available by upgrading affected packages to version 7.1.0.

CVE-2020-10378 at a Glance

CVE Identifier CVE-2020-10378
GHSA Identifier GHSA-3xv8-3j54-hgrp
Severity HIGH
CVSS v3.1 Base Score 5.5
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Pillow
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.5

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

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

How to Fix CVE-2020-10378

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: 7.1.0
pip install pillow>=7.1.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-2020-10378, 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 7.1.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-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. 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

In `libImaging/PcxDecode.c` in Pillow before 7.1.0, an out-of-bounds read can occur when reading PCX files where `state->shuffle` is instructed to read beyond `state->buffer`.

CVE-2020-10378 Affected Pillow Versions

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

References

NVD — CVE-2020-10378 NVD
https://nvd.nist.gov/vuln/detail/CVE-2020-10378
Pillow Source Repository REPOSITORY
https://github.com/python-pillow/Pillow/issues/4750
Pillow Source Repository REPOSITORY
https://github.com/python-pillow/Pillow/pull/4538
Security Fix Commit FIX COMMIT
https://github.com/python-pillow/Pillow/commit/124f4bb591e16212605d0e41c413ed53e242cba2
Security Fix Commit FIX COMMIT
https://github.com/python-pillow/Pillow/commit/6a83e4324738bb0452fbe8074a995b1c73f08de7#diff-9478f2787e3ae9668a15123b165c23ac
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-3xv8-3j54-hgrp
Pillow Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2020-77.yaml
Pillow Source Repository REPOSITORY
https://github.com/pypa/advisory-db/blob/7872b0a91b4d980f749e6d75a81f8cc1af32829f/vulns/pillow/PYSEC-2020-77.yaml
Pillow Source Repository REPOSITORY
https://github.com/python-pillow/Pillow
Pillow Source Repository REPOSITORY
https://github.com/python-pillow/Pillow/commits/master/src/libImaging
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BEBCPE4F2VHTIT6EZA2YZQZLPVDEBJGD
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HOKHNWV2VS5GESY7IBD237E7C6T3I427
Pillow Release RELEASE
https://pillow.readthedocs.io/en/stable/releasenotes/6.2.3.html
Pillow Release RELEASE
https://pillow.readthedocs.io/en/stable/releasenotes/7.1.0.html
usn.ubuntu.com/4430-1 WEB
https://usn.ubuntu.com/4430-1
usn.ubuntu.com/4430-2 WEB
https://usn.ubuntu.com/4430-2

Frequently Asked Questions

What is CVE-2020-10378?
CVE-2020-10378 is a security vulnerability in Pillow involving Out-of-bounds read in Pillow under CWE-125: Out-of-bounds Read.
Which Pillow versions are affected?
Affected versions include releases prior to 7.1.0 across affected packages: pillow.
What version fixes CVE-2020-10378?
Upgrading to 7.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pillow affected?
Yes, pillow is affected in releases prior to 7.1.0. Upgrade your dependency to 7.1.0 or later.
What is the CVSS score of CVE-2020-10378?
CVE-2020-10378 has a CVSS v3.1 base score of 5.5 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2020-10378?
CVE-2020-10378 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check PyPI dependencies for CVE-2020-10378?
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-3xv8-3j54-hgrp",
  "modified" : "2024-10-09T20:52:58Z",
  "published" : "2021-11-03T18:04:53Z",
  "aliases" : [ "CVE-2020-10378" ],
  "summary" : "Out-of-bounds read in Pillow",
  "details" : "In `libImaging/PcxDecode.c` in Pillow before 7.1.0, an out-of-bounds read can occur when reading PCX files where `state->shuffle` is instructed to read beyond `state->buffer`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pillow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-10378"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/issues/4750"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/pull/4538"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/commit/124f4bb591e16212605d0e41c413ed53e242cba2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/commit/6a83e4324738bb0452fbe8074a995b1c73f08de7#diff-9478f2787e3ae9668a15123b165c23ac"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-3xv8-3j54-hgrp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2020-77.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-db/blob/7872b0a91b4d980f749e6d75a81f8cc1af32829f/vulns/pillow/PYSEC-2020-77.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/python-pillow/Pillow"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/commits/master/src/libImaging"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BEBCPE4F2VHTIT6EZA2YZQZLPVDEBJGD"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HOKHNWV2VS5GESY7IBD237E7C6T3I427"
  }, {
    "type" : "WEB",
    "url" : "https://pillow.readthedocs.io/en/stable/releasenotes/6.2.3.html"
  }, {
    "type" : "WEB",
    "url" : "https://pillow.readthedocs.io/en/stable/releasenotes/7.1.0.html"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4430-1"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4430-2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-03T17:26:02Z",
    "nvd_published_at" : "2020-06-25T19:15:00Z"
  }
}