Miggo Logo

CVE-2022-1993: Path Traversal in Git HTTP endpoints in Gogs

8.1

CVSS Score
3.1

Basic Information

EPSS Score
0.5898%
Published
6/8/2022
Updated
1/27/2023
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
gogs.io/gogsgo< 0.12.90.12.9

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from improper path sanitization in Git HTTP request handling. The commit diff shows the HTTP handler in http.go previously used raw user input (m[1]) to build repository paths. The patch introduced pathutil.Clean() and validation checks, confirming the vulnerability existed in the original path handling logic. The HTTP function's direct use of unsanitized user input for file system operations matches the CWE-22 path traversal pattern.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t T** m*li*ious us*r is **l* to *r**t *TTP r*qu*sts to ****ss un*ut*oriz** *it *ir**tori*s. *ll inst*ll*tions wit* *r* *****t**. ### P*t***s P*t* *l**nin* **s ***ommo**t** *or *it *TTP *n*points. Us*rs s*oul* up*r*** to *.**.* or t** l*t*

Reasoning

T** vuln*r**ility st*mm** *rom improp*r p*t* s*nitiz*tion in *it *TTP r*qu*st **n*lin*. T** *ommit *i** s*ows t** `*TTP` **n*l*r in `*ttp.*o` pr*viously us** r*w us*r input (m[*]) to *uil* r*pository p*t*s. T** p*t** intro*u*** `p*t*util.*l**n()` *n*