Miggo Logo

CVE-2020-10571:
Potential buffer overflow in psd-tools

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.61007%
Published
3/16/2020
Updated
10/21/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
psd-toolspip>= 1.8.37, < 1.9.31.9.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The core vulnerability stems from the RLE decoding functions in both Cython (_rle.pyx) and Python (rle.py) implementations. The pre-patch code in _rle.decode performed unsafe memory operations without validating:

  1. Whether the source data buffer had sufficient bytes for the claimed RLE header length
  2. Whether the destination buffer had enough space for the decoded output This allowed attackers to craft PSD files that overread/overwrite memory. The Python version (rle.decode) had similar logic but in pure Python, which would throw IndexError instead of buffer overflow when Cython wasn't installed. The commit diff shows critical guard clauses were added to both implementations to validate buffer boundaries.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t *n issu* w*s *is*ov*r** in ps*-tools ***or* *.*.*. T** *yt*on impl*m*nt*tion o* RL* ***o*in* *i* not ****k *or m*l*orm** PS* input **t* *urin* ***o*in* to t** PIL.Im*** or NumPy *orm*t, l***in* to * *u***r Ov*r*low. ### P*t***s Us*rs o* p

Reasoning

T** *or* vuln*r**ility st*ms *rom t** RL* ***o*in* *un*tions in *ot* *yt*on (_rl*.pyx) *n* Pyt*on (rl*.py) impl*m*nt*tions. T** pr*-p*t** *o** in _rl*.***o** p*r*orm** uns*** m*mory op*r*tions wit*out v*li**tin*: *. W**t**r t** sour** **t* *u***r ***