Path traversal in Grafana CortexGHSA-jphm-g89m-v42p
Fix: cortexproject/cortex#4375GHSA-jphm-g89m-v42p is a Path Traversal vulnerability in github.com/cortexproject/cortex. No vendor fix is recorded yet; mitigation options are listed below.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
github.com/cortexproject/cortexReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
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.)
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/cortexproject/cortex | all versions | No fix |
Affected Products
cortexlinuxfoundationDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/cortexproject/cortex, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Remediation status
No patched version of github.com/cortexproject/cortex has shipped for GHSA-jphm-g89m-v42p yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.
Mitigate without a patch
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
CVE-2021-36157 refers to a directory traversal issue in Grafana Cortex, which is neither shipped in Red Hat Enterprise Linux, nor it has any dependency with Grafana package, hence, not-affected.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenShift Container Platform 4.13 | openshift4/ose-cluster-storage-operator:v4.13.0-202305181415.p0.g6479617.assembly.stream | RHSA-2023:3304 |
| Red Hat OpenShift Container Platform 4.14 | openshift4/ose-cluster-storage-operator:v4.14.0-202310201027.p0.gdbb1514.assembly.stream | RHSA-2023:5006 |
Frequently Asked Questions
Is GHSA-jphm-g89m-v42p in your dependencies?
Find it across Go, including transitive dependencies.