CVE-2021-27923: Denial of Service in Pillow
Summary
CVE-2021-27923: Pillow Denial of Service by Uncontrolled Resource Consumption. Affects pillow versions < 8.1.2. Fixed in 8.1.2. How to fix ↓
Also tracked for
- pillow · Bitnami
- py3-pillow · Alpine:v3.14
The same CVE-2021-27923 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Pillow is a popular Python imaging library that provides support for opening, manipulating, and saving many different image file formats. It is widely used in various applications for image processing and manipulation. However, versions of Pillow before 8.1.1 are vulnerable to a Denial of Service (DoS) attack due to uncontrolled resource consumption. This vulnerability arises from the improper checking of the reported size of an ICO container within an image, allowing an attacker to trigger a large memory allocation, leading to excessive memory consumption.
Vulnerability Detail
The vulnerability in Pillow before version 8.1.1 allows attackers to exploit the improper size checking of an ICO container within an image. By providing a specially crafted image, an attacker can trigger a memory allocation that can be very large, leading to excessive memory consumption. This can result in a Denial of Service (DoS) condition, causing the affected application to become unresponsive or crash. The impact of this vulnerability can be severe, especially in scenarios where the application processes a large number of images or where memory resources are limited.
How To Fix
Latest published version: 13.0.0 as of 22 Oct 2026
pip install --upgrade "pillow==13.0.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
8.1.2
This is the first release that contains the fix.
pip install --upgrade "pillow==8.1.2"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is essential to update to the fixed version of Pillow to mitigate the risk of a DoS attack.
Conclusion
The vulnerability in Pillow before version 8.1.1 can lead to a Denial of Service (DoS) attack due to uncontrolled resource consumption. It is crucial for users to update to the fixed version to mitigate the risk of a DoS condition. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for pillow →
FAQ
This vulnerability can lead to a Denial of Service (DoS) condition, causing the affected application to become unresponsive or crash.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities without requiring access to the code or installation.
The CVSS score of this vulnerability is 7.5, indicating a high severity level.
No, only versions before 8.1.1 are vulnerable. It is recommended to upgrade to the fixed version to mitigate the risk.
No, there is no known workaround. Updating to the fixed version is the recommended solution.
Related vulnerabilities
Recent vulnerabilities recorded for pillow.