CVE-2022-46146 is a medium-severity (CVSS 6.2) Improper Authentication vulnerability in github.com/prometheus/exporter-toolkit. 3 public exploit or proof-of-concept references are indexed, so weaponization risk is real. A fix is available for github.com/prometheus/exporter-toolkit — see the affected versions and patch details below.
Prometheus Exporter Toolkit vulnerable to basic authentication bypass
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
github.com/prometheus/exporter-toolkit🐹github.com/prometheus/exporter-toolkitReal-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
Impact
Prometheus and its exporters can be secured by a web.yml file that specifies usernames and hashed passwords for basic authentication.
Passwords are hashed with bcrypt, which means that even if you have access to the hash, it is very hard to find the original password back.
However, a flaw in the way this mechanism was implemented in the exporter toolkit makes it possible with people who know the hashed password to authenticate against Prometheus.
A request can be forged by an attacker to poison the internal cache used to cache the computation of hashes and make subsequent requests successful. This cache is used in both happy and unhappy scenarios in order to limit side channel attacks that could tell an attacker if a user is present in the file or not.
Patches
The exporter-toolkit v0.7.3 and v0.8.2 have been released to address this issue.
Workarounds
There is no workaround but attacker must have access to the hashed password, stored in disk, to bypass the authentication.
Credit
We want to thank Lei Wan reporting this security issue.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/prometheus/exporter-toolkit | all versions | 0.7.2go get github.com/prometheus/exporter-toolkit@v0.7.2 |
| 🐹Go | github.com/prometheus/exporter-toolkit | ≥ 0.8.0&&< 0.8.2 | 0.8.2go get github.com/prometheus/exporter-toolkit@v0.8.2 |
Affected Products
exporter toolkitprometheusResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/prometheus/exporter-toolkit, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/prometheus/exporter-toolkit to 0.7.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-46146 is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
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.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenShift Container Platform 4.11 | openshift4/ose-thanos-rhel8:v4.11.0-202308311243.p0.g99b6e03.assembly.stream | RHSA-2023:5001 |
| Red Hat OpenShift Container Platform 4.12 | openshift4/ose-thanos-rhel8:v4.12.0-202305022015.p0.g9f2b5ff.assembly.stream | RHSA-2023:2110 |
| Red Hat OpenShift Container Platform 4.13 | openshift4/ose-kube-state-metrics:v4.13.0-202304190216.p0.g4b96984.assembly.stream | RHSA-2023:1326 |
Frequently Asked Questions
Is CVE-2022-46146 in your dependencies?
Find it across Go, including transitive dependencies.