Miggo Logo

CVE-2022-30427: Path traversal in ginadmin

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.69063%
Published
5/26/2022
Updated
1/27/2023
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/gphper/ginadmingo<= 0.1.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from unsanitized use of user-controlled path parameters in two controller methods. The pre-patch code directly concatenated configs.RootPath with c.Query("path") using gstrings.JoinStr, without validating if the resolved path stays within the intended directory tree. The commit 726109f fixes this by introducing filesystem.FilterPath which performs path containment checks. The vulnerable functions are clearly identified in the GitHub issue (#8) and the diff shows the exact lines where unsafe path handling occurred.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

In *in**min t*rou** **-**-**** t** in*omin* p*t* v*lu* is not *ilt*r**, r*sultin* in *ir**tory tr*v*rs*l. * [p*t**](*ttps://*it*u*.*om/*p*p*r/*in**min/*ommit/****************************************) is *v*il**l* on t** `m*st*r` *r*n** o* t** r*posit

Reasoning

T** vuln*r**ility st*ms *rom uns*nitiz** us* o* us*r-*ontroll** p*t* p*r*m*t*rs in two *ontroll*r m*t*o*s. T** pr*-p*t** *o** *ir**tly *on**t*n*t** `*on*i*s.RootP*t*` wit* `*.Qu*ry("p*t*")` usin* `*strin*s.JoinStr`, wit*out v*li**tin* i* t** r*solv**