CVE-2016-9189: Pillow Pillow Integer Overflow Vulnerability
MODERATECVE-2016-9189 is a MODERATE (CVSS 5.5) pillow integer overflow vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Pillow libraries in the PyPI ecosystem. The issue involves pillow integer overflow in map.c. Remediation is available by upgrading affected packages to version 3.3.2.
CVE-2016-9189 at a Glance
Security Impact
CVSS: 5.5
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:N/A:N).
How to Fix CVE-2016-9189
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.
pip install pillow>=3.3.2
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-9189, 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-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. 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
CVE-2016-9189 Affected Pillow Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pillow
|
PyPI |
< 3.3.2
|
3.3.2
|
References
Frequently Asked Questions
What is CVE-2016-9189?
Which Pillow versions are affected?
What version fixes CVE-2016-9189?
Is pillow affected?
What is the CVSS score of CVE-2016-9189?
What CWE is associated with CVE-2016-9189?
How can I check PyPI dependencies for CVE-2016-9189?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rwr3-c2q8-gm56",
"modified" : "2024-10-08T13:06:30Z",
"published" : "2018-07-24T20:08:27Z",
"aliases" : [ "CVE-2016-9189" ],
"summary" : "Pillow Integer overflow in Map.c",
"details" : "Pillow before 3.3.2 allows context-dependent attackers to obtain sensitive information by using the \"crafted image file\" approach, related to an \"Integer Overflow\" issue affecting the `Image.core.map_buffer` in `map.c` component.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/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:N/PR:N/UI:A/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" : "3.3.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-9189"
}, {
"type" : "WEB",
"url" : "https://github.com/python-pillow/Pillow/issues/2105"
}, {
"type" : "WEB",
"url" : "https://github.com/python-pillow/Pillow/pull/2146/commits/c50ebe6459a131a1ea8ca531f10da616d3ceaa0f"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-rwr3-c2q8-gm56"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2016-8.yaml"
}, {
"type" : "WEB",
"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-190" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:56:09Z",
"nvd_published_at" : null
}
}