Miggo Logo

CVE-2021-28675: Pillow denial of service

5.5

CVSS Score
3.1

Basic Information

EPSS Score
0.26269%
Published
6/8/2021
Updated
10/9/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
Pillowpip< 8.2.08.2.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the _layerinfo function in PsdImagePlugin.py, which processes PSD layer information. The commit diff shows the vulnerability was fixed by adding a check comparing 'ct_bytes' (data block size) against 'abs(ct) * 20' (required bytes for claimed layers). Prior to 8.2.0, this validation was missing, allowing attackers to specify an unrealistic number of layers that would exhaust resources during parsing. The CVE description and patch both directly reference this function as the source of the missing sanity check.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n issu* w*s *is*ov*r** in Pillow ***or* *.*.*. `PS*Im***Plu*in.Ps*Im****il*` l**k** * s*nity ****k on t** num**r o* input l*y*rs r*l*tiv* to t** siz* o* t** **t* *lo*k. T*is *oul* l*** to * *oS on `Im***.op*n` prior to `Im***.lo**`.

Reasoning

T** vuln*r**ility st*ms *rom t** _l*y*rin*o *un*tion in Ps*Im***Plu*in.py, w*i** pro**ss*s PS* l*y*r in*orm*tion. T** *ommit *i** s*ows t** vuln*r**ility w*s *ix** *y ***in* * ****k *omp*rin* '*t_*yt*s' (**t* *lo*k siz*) ***inst '**s(*t) * **' (r*qui