Miggo Logo

CVE-2020-36560: go-unzip vulnerable to Path Traversal

9.1

CVSS Score
3.1

Basic Information

EPSS Score
0.38947%
Published
12/28/2022
Updated
8/28/2023
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/artdarek/go-unzipgo< 2.0.02.0.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the Extract method in unzip.go which handled zip entry names without adequate path validation. The GitHub patch adds a critical path sanitization check (strings.HasPrefix) to this exact function, confirming it was the vulnerable point. The CVE description and Go vulnerability report (GO-2020-0034) explicitly reference this function as the affected component. The pre-patch code joined user-controlled filenames with the target directory without verifying if the resulting path remained within the designated directory boundary.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

*u* to improp*r p*t* s*ntiz*tion, *r**iv*s *ont*inin* r*l*tiv* *il* p*t*s **n **us* *il*s to ** writt*n (or ov*rwritt*n) outsi** o* t** t*r**t *ir**tory.

Reasoning

T** vuln*r**ility st*ms *rom t** `*xtr**t` m*t*o* in `unzip.*o` w*i** **n*l** zip *ntry n*m*s wit*out ***qu*t* p*t* v*li**tion. T** *it*u* p*t** ***s * *riti**l p*t* s*nitiz*tion ****k (`strin*s.**sPr**ix`) to t*is *x**t *un*tion, *on*irmin* it w*s t