# CVE-2022-46146: Prometheus Exporter Toolkit vulnerable to basic authentication bypass

> Attackers with access to hashed passwords can bypass authentication in Prometheus exporters by poisoning the cache, requiring an upgrade to fix.

- **Severity:** Medium 6.2 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Nov 2022
- **Updated:** 3 Aug 2024
- **Also known as:** AZL-41992, CLEANSTART-2026-PO69653, DEBIAN-CVE-2022-46146, GHSA-7rg2-cxvp-9p7p, GO-2022-1130, SUSE-SU-2023:0460-1, SUSE-SU-2023:0465-1, SUSE-SU-2023:0467-1, SUSE-SU-2023:1857-1, SUSE-SU-2023:1858-1, SUSE-SU-2023:1859-1, UBUNTU-CVE-2022-46146, openSUSE-SU-2024:12650-1, openSUSE-SU-2024:12691-1, openSUSE-SU-2024:12700-1, openSUSE-SU-2024:12872-1, openSUSE-SU-2024:12904-1

## What is CVE-2022-46146?

CVE-2022-46146 is a medium-severity authentication bypass vulnerability in prometheus exporter-toolkit, published on 29 Nov 2022. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Prometheus Exporter Toolkit is a utility package to build exporters. Prior to versions 0.7.2 and 0.8.2, if someone has access to a Prometheus web.yml file and users' bcrypted passwords, they can bypass security by poisoning the built-in authentication cache. Versions 0.7.2 and 0.8.2 contain a fix for the issue. There is no workaround, but attacker must have access to the hashed password to use this functionality.

Weakness: CWE-303 (Incorrect Implementation of Authentication Algorithm), CWE-287 (Improper Authentication)

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

5 open source packages ship an affected version, including github.com/prometheus/exporter-toolkit. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/prometheus/exporter-toolkit` | Go | All versions | 0.7.2, 0.8.2 |
| `github.com/prometheus/exporter-toolkit` | Go | All versions | 0.7.2 |
| `github.com/prometheus/exporter-toolkit` | Go | All versions | 0.7.2 |
| `github.com/prometheus/exporter-toolkit` | Go | From 0.8.0 | 0.8.2 |
| `github.com/prometheus/exporter-toolkit` | Go | From 0.8.0 | 0.8.2 |
| `prometheus-ha_cluster_exporter` | SUSE:Linux Enterprise Module for SAP Applications 15 SP1 | All versions | 1.3.1+git.1676027782.ad3c0e9-150000.1.24.1 |
| `prometheus-ha_cluster_exporter` | SUSE:Linux Enterprise Module for SAP Applications 15 SP2 | All versions | 1.3.1+git.1676027782.ad3c0e9-150200.3.21.1 |
| `prometheus-ha_cluster_exporter` | SUSE:Linux Enterprise Module for SAP Applications 15 SP3 | All versions | 1.3.1+git.1676027782.ad3c0e9-150200.3.21.1 |
| `prometheus-ha_cluster_exporter` | SUSE:Linux Enterprise Module for SAP Applications 15 SP4 | All versions | 1.3.1+git.1676027782.ad3c0e9-150200.3.21.1 |
| `prometheus-ha_cluster_exporter` | SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | All versions | 1.3.1+git.1676027782.ad3c0e9-4.26.1 |
| `prometheus-ha_cluster_exporter` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 1.3.1+git.1676027782.ad3c0e9-4.26.1 |
| `golang-github-prometheus-prometheus` | SUSE:Manager Client Tools 12 | All versions | 2.32.1-1.41.1 |
| `golang-github-prometheus-prometheus` | SUSE:Manager Client Tools 15 | All versions | 2.32.1-150000.3.44.1 |
| `golang-github-prometheus-prometheus` | SUSE:Manager Proxy Module 4.2 | All versions | 2.32.1-150100.4.12.1 |
| `golang-github-prometheus-prometheus` | SUSE:Manager Proxy Module 4.3 | All versions | 2.32.1-150100.4.12.1 |
| `golang-github-prometheus-prometheus` | openSUSE:Leap 15.4 | All versions | 2.32.1-150100.4.12.1 |
| `prometheus-ha_cluster_exporter` | openSUSE:Leap 15.4 | All versions | 1.3.1+git.1676027782.ad3c0e9-150200.3.21.1 |
| `golang-github-prometheus-prometheus` | openSUSE:Tumbleweed | All versions | 2.41.0-1.1 |
| `grafana` | openSUSE:Tumbleweed | All versions | 8.5.20-2.1 |
| `prometheus-blackbox_exporter` | openSUSE:Tumbleweed | All versions | 0.19.0-13.1 |
| `prometheus-ha_cluster_exporter` | openSUSE:Tumbleweed | All versions | 1.3.1+git.1676027782.ad3c0e9-2.1 |
| `prometheus-postgres_exporter` | openSUSE:Tumbleweed | All versions | 0.10.1-2.1 |

Products: Prometheus Exporter Toolkit.

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

Upgrade github.com/prometheus/exporter-toolkit to a fixed version for your release line: 0.7.2 or 0.8.2.

## Is CVE-2022-46146 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2022-46146 is a medium-severity authentication bypass vulnerability in prometheus exporter-toolkit, published on 29 Nov 2022. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-46146 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/prometheus/exporter-toolkit (Go): affected all versions; fixed in 0.7.2, 0.8.2
- github.com/prometheus/exporter-toolkit (Go): affected all versions; fixed in 0.7.2
- github.com/prometheus/exporter-toolkit (Go): affected all versions; fixed in 0.7.2
- github.com/prometheus/exporter-toolkit (Go): affected from 0.8.0; fixed in 0.8.2
- github.com/prometheus/exporter-toolkit (Go): affected from 0.8.0; fixed in 0.8.2

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-46146/ (Markdown: https://insights.sbomify.com/CVE-2022-46146/index.md)
```

## Sources

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

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