---
id: "GHSA-jgpv-4h4c-xhw3"
kind: "vulnerability"
aliases: ["GHSA-jgpv-4h4c-xhw3"]
title: "Duplicate Advisory: Uncontrolled Resource Consumption in pillow"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "withdrawn"
category: "package"
products: [{"name": "pillow", "fixed": ["8.1.2"], "affected": "< 8.1.1", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-400", "package", "pillow", "python", "self-hosted"]
not_affected_if: ["pillow-8.1.2-or-later", "trusted-input-only"]
published_at: "2021-04-23T16:54:36+00:00"
first_seen_at: "2026-10-27T19:04:56+00:00"
updated_at: "2026-10-27T19:05:59+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-jgpv-4h4c-xhw3", "first_seen_at": "2026-10-27T19:04:56+00:00"}]
---

# Duplicate Advisory: Uncontrolled Resource Consumption in pillow

Pillow before 8.1.1 does not check the declared size of an image inside a BLP container, so an attempted memory allocation can be very large. An attacker who supplies a crafted image can exhaust memory and crash the process that reads it.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:pillow affected < 8.1.1 fixed 8.1.2

## How to check

- `pip show pillow` and confirm the version is below `8.1.1`
- Search the project for `PIL.Image.open` or `Image.open` calls that read untrusted uploads

## Fix

- Upgrade pillow to `8.1.2` or later, the fixed version named in the source
- This advisory is withdrawn as a duplicate of GHSA-f4w8-cv6p-x6r5; track that advisory for the canonical record

## Timeline

- 2026-10-27T19:04:56+00:00 ghsa https://github.com/advisories/GHSA-jgpv-4h4c-xhw3

## From the sources

## Duplicate Advisory

This advisory has been withdrawn because it is a duplicate of GHSA-f4w8-cv6p-x6r5. This link is maintained to preserve external references.

## Original Description
### Impact
_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._

### Patches
_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._

### Workarounds
_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._

### References
https://nvd.nist.gov/vuln/detail/CVE-2021-27921

### For more information
If you have any questions or comments about this advisory:
* Open an issue in [example link to repo](http://example.com)
* Email us at [example email address](mailto:example@example.com)

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
