Miggo Logo

CVE-2022-29180: Server-Side Request Forgery in charm

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.46769%
Published
5/24/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:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/charmbracelet/charmgo>= 0.9.0, < 0.12.10.12.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from unsanitized path parameters in file operations. The commit 3c90668 adds path sanitization using filepath.Clean to these three handler functions. Before the patch, they directly used pattern.Path() from request context without validation, allowing path traversal attacks via specially crafted paths. These functions directly interact with the filesystem using user-controlled input, making them the clear attack surface for SSRF and file system manipulation.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

W*'v* *is*ov*r** * vuln*r**ility in w*i** *tt**k*rs *oul* *or** *TTP r*qu*sts to m*nipul*t* t** `***rm` **t* *ir**tory to ****ss or **l*t* *nyt*in* on t** s*rv*r. T*is **s ***n p*t**** in *ttps://*it*u*.*om/***rm*r***l*t/***rm/*ommit/****************

Reasoning

T** vuln*r**ility st*mm** *rom uns*nitiz** p*t* p*r*m*t*rs in *il* op*r*tions. T** *ommit ******* ***s p*t* s*nitiz*tion usin* `*il*p*t*.*l**n` to t**s* t*r** **n*l*r `*un*tions`. ***or* t** p*t**, t**y *ir**tly us** `p*tt*rn.P*t*()` *rom r*qu*st *on