Bug 2183169 (CVE-2021-36157)

Summary: CVE-2021-36157 cortex: Grafana Cortex directory traversal
Product: [Other] Security Response Reporter: Avinash Hanwate <ahanwate>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: amctagga, dfreiber, gparvin, grafana-maint, jburrell, jcantril, jkurik, muagarwa, nathans, nbecker, njean, ocs-bugs, owatkins, pahickey, periklis, rogbas, scox, stcannon, teagle, vkumar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A flaw in the Grafana cortex package could allow a remote attacker to traverse directories on the system caused by improper input validation by the X-Scope-OrgID header value. An attacker could send a specially-crafted URL request containing "dot-dot" sequences (/../) to view some of the contents in the error message.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-31 01:12:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2183170, 2185556, 2185557, 2185717, 2185718, 2185719    
Bug Blocks: 2180566    

Description Avinash Hanwate 2023-03-30 13:35:54 UTC
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.)

https://github.com/cortexproject/cortex/pull/4375
https://grafana.com/docs/grafana/latest/release-notes/

Comment 1 Avinash Hanwate 2023-03-30 13:36:14 UTC
Created grafana tracking bugs for this issue:

Affects: fedora-all [bug 2183170]

Comment 6 errata-xmlrpc 2023-05-30 20:13:57 UTC
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 4.13

Via RHSA-2023:3304 https://access.redhat.com/errata/RHSA-2023:3304

Comment 7 Product Security DevOps Team 2023-05-31 01:12:08 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2021-36157

Comment 8 errata-xmlrpc 2023-10-31 12:54:41 UTC
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 4.14

Via RHSA-2023:5006 https://access.redhat.com/errata/RHSA-2023:5006