Miggo Logo

CVE-2021-36156:
Path traversal in Grafana Loki

5.3

CVSS Score
3.1

Basic Information

EPSS Score
0.59605%
Published
9/2/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/grafana/lokigo< 2.3.02.3.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from using unsanitized X-Scope-OrgID values in file path construction. The ruler component's rule group synchronization logic (SyncRuleGroups) directly used tenant IDs to build filesystem paths. Since Loki's ruler inherits from Cortex's implementation, and the fix involved updating Cortex's tenant ID validation, the vulnerable function would be in the rule management logic that handles tenant-specific paths. The description explicitly mentions rules file path construction as the attack vector, aligning with the ruler component's responsibilities.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

*n issu* w*s *is*ov*r** in *r***n* Loki t*rou** *.*.*. T** *****r v*lu* X-S*op*-Or*I* is us** to *onstru*t *il* p*t*s *or rul*s *il*s, *n* i* *r**t** to *on*u*t *ir**tory tr*v*rs*l su** *s ** ../../s*nsitiv*/p*t*/in/**ploym*nt p*t*n*m*, t**n Loki wil

Reasoning

T** vuln*r**ility st*ms *rom usin* uns*nitiz** X-S*op*-Or*I* v*lu*s in *il* p*t* *onstru*tion. T** rul*r *ompon*nt's rul* *roup syn**roniz*tion lo*i* (`Syn*Rul**roups`) *ir**tly us** t*n*nt I*s to *uil* *il*syst*m p*t*s. Sin** Loki's rul*r in**rits *