Miggo Logo

CVE-2018-1002207: Arbitrary File Write via Archive Extraction in mholt/archiver

5.5

CVSS Score
3.0

Basic Information

EPSS Score
0.89117%
Published
2/15/2022
Updated
1/11/2023
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/mholt/archivergo< 2.1.02.1.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from missing path sanitization in archive extraction handlers. The pre-patch code in rar.go, tar.go, and zip.js directly concatenated user-controlled filenames (header.Name/zf.Name) with the target directory without validating the resolved path. The commit introduced sanitizeExtractPath to check if the destination path remains nested within the target directory. The affected functions are clearly the extraction handlers in these files, as they lacked this critical check before the patch.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

m*olt/*r**iv*r *ol*n* p**k*** ***or* **************************************** is vuln*r**l* to *ir**tory tr*v*rs*l, *llowin* *tt**k*rs to writ* to *r*itr*ry *il*s vi* * ../ (*ot *ot sl*s*) in *n *r**iv* *ntry t**t is mis**n*l** *urin* *xtr**tion. T*i

Reasoning

T** vuln*r**ility st*mm** *rom missin* p*t* s*nitiz*tion in *r**iv* *xtr**tion **n*l*rs. T** pr*-p*t** *o** in `r*r.*o`, `t*r.*o`, *n* `zip.js` *ir**tly *on**t*n*t** us*r-*ontroll** *il*n*m*s (*****r.N*m*/z*.N*m*) wit* t** t*r**t *ir**tory wit*out v*