GHSA-jgpv-4h4c-xhw3: Pillow Remote Code Execution Vulnerability
MODERATEGHSA-jgpv-4h4c-xhw3 is a MODERATE (CVSS 7.5) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Pillow libraries in the PyPI ecosystem. The issue involves uncontrolled resource consumption in pillow. Remediation is available by upgrading affected packages to version 8.1.2.
GHSA-jgpv-4h4c-xhw3 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix GHSA-jgpv-4h4c-xhw3
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>=8.1.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 GHSA-jgpv-4h4c-xhw3, 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 8.1.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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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
GHSA-jgpv-4h4c-xhw3 Affected Pillow Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pillow
|
PyPI |
< 8.1.2
|
8.1.2
|
References
Frequently Asked Questions
What is GHSA-jgpv-4h4c-xhw3?
Which Pillow versions are affected?
What version fixes GHSA-jgpv-4h4c-xhw3?
Is pillow affected?
What is the CVSS score of GHSA-jgpv-4h4c-xhw3?
What CWE is associated with GHSA-jgpv-4h4c-xhw3?
How can I check PyPI dependencies for GHSA-jgpv-4h4c-xhw3?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jgpv-4h4c-xhw3",
"modified" : "2021-04-22T17:01:01Z",
"published" : "2021-04-23T16:54:36Z",
"aliases" : [ ],
"summary" : "Uncontrolled Resource Consumption in pillow",
"details" : "### Impact\n_Pillow before 8.1.1 allows attackers to cause a denial of service (memory consumption) because the reported size of a contained image is not properly checked for a BLP container, and thus an attempted memory allocation can be very large._\n\n### Patches\n_An issue was discovered in Pillow before 6.2.0. When reading specially crafted invalid image files, the library can either allocate very large amounts of memory or take an extremely long period of time to process the image._\n\n### Workarounds\n_An issue was discovered in Pillow before 6.2.0. When reading specially crafted invalid image files, the library can either allocate very large amounts of memory or take an extremely long period of time to process the image._\n\n### References\nhttps://nvd.nist.gov/vuln/detail/CVE-2021-27921\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [example link to repo](http://example.com)\n* Email us at [example email address](mailto:example@example.com)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "pillow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "8.1.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "< 8.1.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/calix2/pyVulApp/security/advisories/GHSA-jgpv-4h4c-xhw3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-22T17:01:01Z",
"nvd_published_at" : null
}
}