VYPR
High severityNVD Advisory· Published Sep 3, 2021· Updated Sep 16, 2024

Regular Expression Denial of Service (ReDoS)

CVE-2021-23437

Description

The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb function.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Pillow versions 5.2.0 through 8.3.2 are vulnerable to regular expression denial of service (ReDoS) via the getrgb function.

Vulnerability

The getrgb function in Pillow (Python Imaging Library) is vulnerable to Regular Expression Denial of Service (ReDoS) due to a poorly crafted regular expression that can cause catastrophic backtracking when processing certain color strings. Affected versions are Pillow 5.2.0 up to but not including 8.3.2 [1][2].

Exploitation

An attacker can trigger the ReDoS by providing a specially crafted input string to the getrgb function, such as a long string with specific patterns that cause the regular expression engine to exhibit exponential behavior. No special privileges or network position is required beyond the ability to supply input to the vulnerable function [3].

Impact

Successful exploitation leads to denial of service (DoS) by causing the application to become unresponsive or crash due to excessive CPU consumption. The confidentiality and integrity of data are not compromised [3].

Mitigation

Upgrade to Pillow version 8.3.2 or later, which includes a fix in commit 9e08eb8f78fdfd2f476e1b20b7cf38683754866b [1][4]. No workarounds are available for earlier versions.

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
pillowPyPI
>= 5.2.0, < 8.3.28.3.2

Affected products

10

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

14

News mentions

0

No linked articles in our index yet.