# CVE-2022-23536: Alertmanager can expose local files content via specially crafted config

> Attackers can read local files via crafted Alertmanager configs in Cortex if the experimental API is enabled, requiring an upgrade to patched versions.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 19 Dec 2022
- **Updated:** 16 Apr 2025
- **Also known as:** GHSA-cq2g-pw6q-hf7j, GO-2022-1175

## What is CVE-2022-23536?

CVE-2022-23536 is a medium-severity path traversal vulnerability in cortexproject cortex, published on 19 Dec 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Cortex provides multi-tenant, long term storage for Prometheus. A local file inclusion vulnerability exists in Cortex versions 1.13.0, 1.13.1 and 1.14.0, where a malicious actor could remotely read local files as a result of parsing maliciously crafted Alertmanager configurations when submitted to the Alertmanager Set Configuration API. Only users of the Alertmanager service where `-experimental.alertmanager.enable-api` or `enable_api: true` is configured are affected. Affected Cortex users are advised to upgrade to patched versions 1.13.2 or 1.14.1. However as a workaround, Cortex administrators may reject Alertmanager configurations containing the `api_key_file` setting in the `opsgenie_configs` section before sending to the Set Alertmanager Configuration API.

Weakness: CWE-73 (External Control of File Name or Path), CWE-641 (Improper Restriction of Names for Files and Other Resources), CWE-184 (Incomplete List of Disallowed Inputs)

## Which versions are affected by CVE-2022-23536?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/cortexproject/cortex` | Go | From 1.13.0 | 1.13.2, 1.14.1 |
| `github.com/cortexproject/cortex` | Go | From 1.13.0 | 1.13.2 |
| `github.com/cortexproject/cortex` | Go | From 1.13.0 | 1.13.2 |
| `github.com/cortexproject/cortex` | Go | From 1.14.0 | 1.14.1 |
| `github.com/cortexproject/cortex` | Go | From 1.14.0 | 1.14.1 |

Products: Linuxfoundation Cortex.

## How do I fix CVE-2022-23536?

Upgrade github.com/cortexproject/cortex to a fixed version for your release line: 1.13.2 or 1.14.1.

## Is CVE-2022-23536 being exploited?

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

## Other vulnerabilities in cortexproject cortex

- [CVE-2021-31232](https://insights.sbomify.com/CVE-2021-31232/): Improper input validation in CNCF Cortex (medium 5.5)
- [CVE-2021-36157](https://insights.sbomify.com/CVE-2021-36157/): Path traversal in Grafana Cortex (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-23536 and fix it if it is affected.

What it is: CVE-2022-23536 is a medium-severity path traversal vulnerability in cortexproject cortex, published on 19 Dec 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-23536 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/cortexproject/cortex (Go): affected from 1.13.0; fixed in 1.13.2, 1.14.1
- github.com/cortexproject/cortex (Go): affected from 1.13.0; fixed in 1.13.2
- github.com/cortexproject/cortex (Go): affected from 1.13.0; fixed in 1.13.2
- github.com/cortexproject/cortex (Go): affected from 1.14.0; fixed in 1.14.1
- github.com/cortexproject/cortex (Go): affected from 1.14.0; fixed in 1.14.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-23536/ (Markdown: https://insights.sbomify.com/CVE-2022-23536/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-23536
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-23536
- OSV: https://osv.dev/vulnerability/CVE-2022-23536

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-23536/
Summaries are generated and may contain mistakes; the official description above is the record.
