CVE-2016-9190: Pillow Arbitrary Code Using "crafted Image Vulnerability

HIGH
Advisory Identifier: GHSA-w4vg-rf63-f3j3
CVSS 7.8
CWE-284
Published
Advisory Summary

CVE-2016-9190 is a HIGH (CVSS 7.8) arbitrary code using "crafted image vulnerability (CWE-284: Improper Access Control) affecting Pillow libraries in the PyPI ecosystem. The issue involves arbitrary code using "crafted image file" approach affecting pillow. Remediation is available by upgrading affected packages to version 3.3.2.

CVE-2016-9190 at a Glance

CVE Identifier CVE-2016-9190
GHSA Identifier GHSA-w4vg-rf63-f3j3
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-284: Improper Access Control
Affected Product Pillow
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.8

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

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 High (I:H)
Availability High (A:H)

How to Fix CVE-2016-9190

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: 3.3.2
pip install Pillow>=3.3.2
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-2016-9190, 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 3.3.2), 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. 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

Pillow before 3.3.2 allows context-dependent attackers to execute arbitrary code by using the "crafted image file" approach, related to an "Insecure Sign Extension" issue affecting the ImagingNew in Storage.c component.

CVE-2016-9190 Affected Pillow Versions

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

References

Frequently Asked Questions

What is CVE-2016-9190?
CVE-2016-9190 is a security vulnerability in Pillow involving Arbitrary code using "crafted image file" approach affecting Pillow under CWE-284: Improper Access Control.
Which Pillow versions are affected?
Affected versions include releases prior to 3.3.2 across affected packages: Pillow.
What version fixes CVE-2016-9190?
Upgrading to 3.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Pillow affected?
Yes, Pillow is affected in releases prior to 3.3.2. Upgrade your dependency to 3.3.2 or later.
What is the CVSS score of CVE-2016-9190?
CVE-2016-9190 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2016-9190?
CVE-2016-9190 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check PyPI dependencies for CVE-2016-9190?
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-w4vg-rf63-f3j3",
  "modified" : "2024-10-08T13:00:28Z",
  "published" : "2018-07-12T14:45:42Z",
  "aliases" : [ "CVE-2016-9190" ],
  "summary" : "Arbitrary code using \"crafted image file\" approach affecting Pillow",
  "details" : "Pillow before 3.3.2 allows context-dependent attackers to execute arbitrary code by using the \"crafted image file\" approach, related to an \"Insecure Sign Extension\" issue affecting the ImagingNew in Storage.c component.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Pillow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-9190"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/issues/2105"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/python-pillow/Pillow/pull/2146/commits/5d8a0be45aad78c5a22c8d099118ee26ef8144af"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-w4vg-rf63-f3j3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2016-9.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/python-pillow/Pillow"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/201612-52"
  }, {
    "type" : "WEB",
    "url" : "http://pillow.readthedocs.io/en/3.4.x/releasenotes/3.3.2.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2016/dsa-3710"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/94234"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:59:34Z",
    "nvd_published_at" : null
  }
}