Miggo Logo

CVE-2020-7666: github.com/u-root/u-root/pkg/cpio Arbitrary File Write via Archive Extraction (Zip Slip)

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.65494%
Published
4/24/2024
Updated
4/24/2024
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:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/u-root/u-root/pkg/cpiogo<= 7.0.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper path sanitization during CPIO extraction. The pull request #1817 shows the fix involved changing path construction from filepath.Join(base, file) to a safer filepath.Join(base, filepath.Join("/", file)) pattern. This indicates CreateFile was the primary function handling file creation with unsafe path handling. The Snyk PoC demonstrates exploitation through archive processing via cpio.CreateFile, confirming this function's role in the vulnerability.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

T*is *****ts *ll v*rsions o* p**k*** *it*u*.*om/u-root/u-root/pk*/*pio up to *n* in*lu*in* *.*.*. It is vuln*r**l* to l***in*, non-l***in* r*l*tiv* p*t* tr*v*rs*l *tt**ks *n* symlink **s** (r*l*tiv* *n* **solut*) p*t* tr*v*rs*l *tt**ks in *pio *il* *

Reasoning

T** vuln*r**ility st*ms *rom improp*r p*t* s*nitiz*tion *urin* *PIO *xtr**tion. T** pull r*qu*st #**** s*ows t** *ix involv** ***n*in* p*t* *onstru*tion *rom *il*p*t*.Join(**s*, *il*) to * s***r *il*p*t*.Join(**s*, *il*p*t*.Join("/", *il*)) p*tt*rn.