CVE-2022-21698 is a high-severity (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in github.com/prometheus/client_golang. A fix is available for github.com/prometheus/client_golang — see the affected versions and patch details below.
Uncontrolled Resource Consumption in promhttp
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2022-21698.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2022-21698 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,738 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
github.com/prometheus/client_golangReal-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
This is the Go client library for Prometheus. It has two separate parts, one for instrumenting application code, and one for creating clients that talk to the Prometheus HTTP API. client_golang is the instrumentation library for Go applications in Prometheus, and the promhttp package in client_golang provides tooling around HTTP servers and clients.
Impact
HTTP server susceptible to a Denial of Service through unbounded cardinality, and potential memory exhaustion, when handling requests with non-standard HTTP methods.
Affected Configuration
In order to be affected, an instrumented software must
- Use any of
promhttp.InstrumentHandler*middleware exceptRequestsInFlight. - Do not filter any specific methods (e.g GET) before middleware.
- Pass metric with
methodlabel name to our middleware. - Not have any firewall/LB/proxy that filters away requests with unknown
method.
Patches
- https://github.com/prometheus/client_golang/pull/962
- https://github.com/prometheus/client_golang/pull/987
Workarounds
If you cannot upgrade to v1.11.1 or above, in order to stop being affected you can:
- Remove
methodlabel name from counter/gauge you use in the InstrumentHandler. - Turn off affected promhttp handlers.
- Add custom middleware before promhttp handler that will sanitize the request method given by Go http.Request.
- Use a reverse proxy or web application firewall, configured to only allow a limited set of methods.
For more information
If you have any questions or comments about this advisory:
- Open an issue in https://github.com/prometheus/client_golang
- Email us at
[email protected]
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/prometheus/client_golang | all versions | 1.11.1go get github.com/prometheus/client_golang@v1.11.1 |
Affected Products
extra packages for enterprise linuxfedoraprojectfedorafedoraprojectclient golangprometheusrdordo_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/prometheus/client_golang, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/prometheus/client_golang to 1.11.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-21698 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
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.
This flaw has been rated as having a moderate impact for two main reasons. The opportunity for a Denial of Service is limited to the golang runtime. In the case of OpenShift Container Platform, this would be restricted within each individual container. Additionally, this is in alignment with upstream's (the Prometheus…
| Product | Fixed in | Advisory |
|---|---|---|
| Logging subsystem for Red Hat OpenShift 5.4 | openshift-logging/elasticsearch-proxy-rhel8:v1.0.0-163 | RHSA-2022:1461 |
| Logging subsystem for Red Hat OpenShift 5.4 | openshift-logging/elasticsearch-rhel8-operator:v5.4.1-4 | RHSA-2022:2216 |
| OADP-1.0-RHEL-8 | oadp/oadp-registry-rhel8:1.0.4-6 | RHSA-2022:6430 |
| OADP-1.0-RHEL-8 | oadp/oadp-mustgather-rhel8:1.0.5-20 | RHSA-2022:7261 |
| OADP-1.1-RHEL-8 | oadp/oadp-velero-plugin-rhel8:1.1.0-20 | RHSA-2022:6290 |
| OADP-1.1-RHEL-8 | oadp/oadp-velero-rhel8:1.1.6-7 | RHSA-2023:5314 |
| OpenShift Logging 5.2 | openshift-logging/elasticsearch-proxy-rhel8:v1.0.0-168 | RHSA-2022:2218 |
| OpenShift Logging 5.3 | openshift-logging/elasticsearch-proxy-rhel8:v1.0.0-171 | RHSA-2022:2217 |
Frequently Asked Questions
Is CVE-2022-21698 in your dependencies?
Find it across Go, including transitive dependencies.