CVE-2016-2533: Pillow Pillow Buffer Overflow Vulnerability
HIGHCVE-2016-2533 is a HIGH (CVSS 6.5) pillow buffer overflow vulnerability (CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer) affecting Pillow libraries in the PyPI ecosystem. The issue involves pillow buffer overflow in imagingpcddecode. Remediation is available by upgrading affected packages to version 3.1.1.
CVE-2016-2533 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2016-2533
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.1.1
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-2533, 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.1.1), 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-119: Improper Restriction of Operations within the Bounds of a Memory Buffer, where the product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. this may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data. 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-2533 Affected Pillow Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pillow
|
PyPI |
< 3.1.1
|
3.1.1
|
References
Frequently Asked Questions
What is CVE-2016-2533?
Which Pillow versions are affected?
What version fixes CVE-2016-2533?
Is pillow affected?
What is the CVSS score of CVE-2016-2533?
What CWE is associated with CVE-2016-2533?
How can I check PyPI dependencies for CVE-2016-2533?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3c5c-7235-994j",
"modified" : "2024-10-08T13:09:01Z",
"published" : "2018-07-24T20:15:13Z",
"aliases" : [ "CVE-2016-2533" ],
"summary" : "Pillow buffer overflow in ImagingPcdDecode",
"details" : "Buffer overflow in the `ImagingPcdDecode` function in `PcdDecode.c` in Pillow before 3.1.1 and Python Imaging Library (PIL) 1.1.7 and earlier allows remote attackers to cause a denial of service (crash) via a crafted PhotoCD file.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "pillow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.1.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-2533"
}, {
"type" : "WEB",
"url" : "https://github.com/python-pillow/Pillow/pull/1706"
}, {
"type" : "WEB",
"url" : "https://github.com/python-pillow/Pillow/commit/5bdf54b5a76b54fb00bd05f2d733e0a4173eefc9#diff-8ff6909c159597e22288ad818938fd6b"
}, {
"type" : "WEB",
"url" : "https://github.com/python-pillow/Pillow/commit/ae453aa18b66af54e7ff716f4ccb33adca60afd4#diff-8ff6909c159597e22288ad818938fd6b"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-3c5c-7235-994j"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2016-19.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/python-pillow/Pillow"
}, {
"type" : "WEB",
"url" : "https://github.com/python-pillow/Pillow/blob/c3cb690fed5d4bf0c45576759de55d054916c165/CHANGES.rst"
}, {
"type" : "WEB",
"url" : "https://github.com/python-pillow/Pillow/blob/c3cb690fed5d4bf0c45576759de55d054916c165/CHANGES.rst?plain=1#L53"
}, {
"type" : "WEB",
"url" : "https://security.gentoo.org/glsa/201612-52"
}, {
"type" : "WEB",
"url" : "http://www.debian.org/security/2016/dsa-3499"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2016/02/02/5"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2016/02/22/2"
}, {
"type" : "WEB",
"url" : "http://www.oracle.com/technetwork/topics/security/bulletinjan2016-2867206.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-119" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T20:54:46Z",
"nvd_published_at" : null
}
}