CVE-2021-36157 Path traversal in Grafana Cortex

Medium 5.3 Published Updated

Attackers can read sensitive files via directory traversal in the X-Scope-OrgID header, exposing deployment contents in error messages.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2021-36157?

CVE-2021-36157 is a medium-severity path traversal vulnerability in n/a, published on 3 Aug 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

An issue was discovered in Grafana Cortex through 1.9.0. The header value X-Scope-OrgID is used to construct file paths for rules files, and if crafted to conduct directory traversal such as ae ../../sensitive/path/in/deployment pathname, then Cortex will attempt to parse a rules file at that location and include some of the contents in the error message. (Other Cortex API requests can also be sent a malicious OrgID header, e.g., tricking the ingester into writing metrics to a different location, but the effect is nuisance rather than information disclosure.)

Weakness: CWE-22

Which versions are affected by CVE-2021-36157?

2 open source packages ship an affected version, including github.com/cortexproject/cortex. It affects 1 product.

PackageAffectedFixed in
github.com/cortexproject/cortex GoAll versions to 1.9.0None
github.com/cortexproject/cortex GoAll versions to 1.9.0None

Products include Linuxfoundation Cortex.

How do I fix CVE-2021-36157?

No fix has been published for CVE-2021-36157 yet. Limit exposure of the affected software until one is available.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2021-36157 being exploited?

There is no known exploitation of CVE-2021-36157 in the wild and no public exploit code.

Sources

Also known as GHSA-jphm-g89m-v42p.

Is CVE-2021-36157 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free