CVE-2021-27923: Denial of Service in Pillow

pillow Updated 02 Oct 2025

Summary

18/03/2021
Yes i
High
7.5

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback