# CVE-2022-21698: Uncontrolled Resource Consumption in promhttp

> Attackers can cause memory exhaustion and denial of service in Go applications using promhttp middleware by sending requests with non-standard HTTP methods.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Feb 2022
- **Updated:** 23 Apr 2025
- **Also known as:** AZL-31981, AZL-33567, AZL-33603, AZL-33611, AZL-33614, AZL-33618, AZL-33620, AZL-33623, AZL-33626, AZL-33634, AZL-33637, AZL-33639, AZL-34541, AZL-34835, AZL-34999, AZL-35012, AZL-35040, AZL-35122, AZL-39665, AZL-43738, AZL-45249, CLEANSTART-2025-KV52215, CLEANSTART-2026-GH89001, CLEANSTART-2026-UP16119, CLEANSTART-2026-UY23574, DEBIAN-CVE-2022-21698, GHSA-cg3q-j54f-5p7p, GO-2022-0322, MGASA-2022-0180, MINI-5hvw-m2qj-9794, MINI-hq86-273v-pvw8, MINI-hrmp-v522-4wcc, MINI-j58w-92r7-mhjg, RHSA-2022:4667, SUSE-RU-2022:2145-1, SUSE-SU-2022:1433-1, SUSE-SU-2022:1434-1, SUSE-SU-2022:1435-1, SUSE-SU-2022:2137-1, SUSE-SU-2022:2139-1, SUSE-SU-2022:2140-1, SUSE-SU-2022:3745-1, SUSE-SU-2026:2241-1, SUSE-SU-2026:2766-1, SUSE-SU-2026:4106-1, UBUNTU-CVE-2022-21698, openSUSE-SU-2024:11965-1, openSUSE-SU-2024:12231-1, openSUSE-SU-2024:12259-1, openSUSE-SU-2026:10634-1, openSUSE-SU-2026:10644-1

## What is CVE-2022-21698?

CVE-2022-21698 is a high-severity denial of service vulnerability in Fedoraproject Extra Packages for Enterprise Linux, published on 15 Feb 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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. In client_golang prior to version 1.11.1, HTTP server is susceptible to a Denial of Service through unbounded cardinality, and potential memory exhaustion, when handling requests with non-standard HTTP methods. In order to be affected, an instrumented software must use any of `promhttp.InstrumentHandler*` middleware except `RequestsInFlight`; not filter any specific methods (e.g GET) before middleware; pass metric with `method` label name to our middleware; and not have any firewall/LB/proxy that filters away requests with unknown `method`. client_golang version 1.11.1 contains a patch for this issue. Several workarounds are available, including removing the `method` label name from counter/gauge used in the InstrumentHandler; turning off affected promhttp handlers; adding custom middleware before promhttp handler that will sanitize the request method given by Go http.Request; and using a reverse proxy or web application firewall, configured to only allow a limited set of methods.

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling), CWE-400 (Uncontrolled Resource Consumption)

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

3 open source packages ship an affected version, including github.com/prometheus/client_golang. It affects 4 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/prometheus/client_golang` | Go | All versions | 1.11.1 |
| `github.com/prometheus/client_golang` | Go | All versions | 1.11.1 |
| `github.com/prometheus/client_golang` | Go | All versions | 1.11.1 |
| `kubevirt` | Red Hat:container_native_virtualization:4.10::el7 | All versions | 0:4.10.1-489.el7 |
| `kubevirt-virtctl` | Red Hat:container_native_virtualization:4.10::el7 | All versions | 0:4.10.1-489.el7 |
| `kubevirt-virtctl-redistributable` | Red Hat:container_native_virtualization:4.10::el7 | All versions | 0:4.10.1-489.el7 |
| `kubevirt` | Red Hat:container_native_virtualization:4.10::el8 | All versions | 0:4.10.1-489.el8 |
| `kubevirt-virtctl` | Red Hat:container_native_virtualization:4.10::el8 | All versions | 0:4.10.1-489.el8 |
| `kubevirt-virtctl-redistributable` | Red Hat:container_native_virtualization:4.10::el8 | All versions | 0:4.10.1-489.el8 |
| `golang-github-prometheus-alertmanager` | SUSE:Enterprise Storage 6 | All versions | 0.23.0-150100.4.7.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Enterprise Storage 6 | All versions | 1.3.0-150100.3.12.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Enterprise Storage 6 | All versions | 1.3.0-150100.3.18.1 |
| `golang-github-prometheus-prometheus` | SUSE:Enterprise Storage 6 | All versions | 2.32.1-150100.4.9.2 |
| `golang-github-prometheus-node_exporter` | SUSE:Enterprise Storage 7 | All versions | 1.3.0-150100.3.12.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Enterprise Storage 7 | All versions | 1.3.0-150100.3.18.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 1.3.0-150100.3.12.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 1.3.0-150100.3.18.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 1.3.0-150100.3.12.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 1.3.0-150100.3.18.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | All versions | 1.3.0-150100.3.12.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | All versions | 1.3.0-150100.3.18.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 1.3.0-150100.3.12.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 1.3.0-150100.3.18.1 |
| `golang-github-vpenso-prometheus_slurm_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 0.20-150300.3.11.2 |
| `golang-github-vpenso-prometheus_slurm_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 0.20-150300.3.11.2 |
| `golang-github-vpenso-prometheus_slurm_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | All versions | 0.20-150300.3.11.2 |
| `golang-github-vpenso-prometheus_slurm_exporter` | SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | All versions | 0.20-150300.3.11.2 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 1.3.0-150000.3.12.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise High Performance Computing 15-LTSS | All versions | 1.3.0-150000.3.12.1 |
| `firewalld` | SUSE:Linux Enterprise Micro 5.1 | All versions | 0.9.3-150300.3.6.1 |
| `firewalld` | SUSE:Linux Enterprise Micro 5.2 | All versions | 0.9.3-150300.3.6.1 |
| `firewalld` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 0.9.3-150300.3.6.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 1.3.0-150100.3.12.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 1.3.0-150100.3.18.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 1.3.0-150100.3.12.1 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 1.3.0-150100.3.18.1 |
| `firewalld` | SUSE:Linux Enterprise Module for Desktop Applications 15 SP3 | All versions | 0.9.3-150300.3.6.1 |
| `golang-github-vpenso-prometheus_slurm_exporter` | SUSE:Linux Enterprise Module for HPC 15 SP7 | All versions | 0.20-150300.3.11.2 |
| `golang-github-vpenso-prometheus_slurm_exporter` | SUSE:Linux Enterprise Module for Package Hub 15 SP7 | All versions | 0.20-150300.3.11.2 |
| `golang-github-prometheus-node_exporter` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 1.3.0-150100.3.12.1 |

Products: Fedoraproject Extra Packages for Enterprise Linux, Fedoraproject Fedora, Prometheus Client Golang, Rdo Project Rdo.

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

Upgrade github.com/prometheus/client_golang to 1.11.1 or later.

## Is CVE-2022-21698 being exploited?

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

## Other vulnerabilities in Fedoraproject Extra Packages for Enterprise Linux

- [CVE-2023-34152](https://insights.sbomify.com/CVE-2023-34152/): Command injection in ImageMagick (critical 9.8)
- [CVE-2022-4170](https://insights.sbomify.com/CVE-2022-4170/): Code injection in rxvt-unicode (critical 9.8)
- [CVE-2022-40315](https://insights.sbomify.com/CVE-2022-40315/): Moodle Minor SQL injection risk in admin user browsing (critical 9.8)
- [CVE-2022-45152](https://insights.sbomify.com/CVE-2022-45152/): Moodle blind Server-Side Request Forgery (SSRF) vulnerability in LTI provider library (critical 9.1)
- [CVE-2022-24882](https://insights.sbomify.com/CVE-2022-24882/): Server side NTLM does not properly check parameters in FreeRDP (critical 9.1)

## Fix prompt for AI coding agents

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

What it is: CVE-2022-21698 is a high-severity denial of service vulnerability in Fedoraproject Extra Packages for Enterprise Linux, published on 15 Feb 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-21698 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/prometheus/client_golang (Go): affected all versions; fixed in 1.11.1
- github.com/prometheus/client_golang (Go): affected all versions; fixed in 1.11.1
- github.com/prometheus/client_golang (Go): affected all versions; fixed in 1.11.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-21698/ (Markdown: https://insights.sbomify.com/CVE-2022-21698/index.md)
```

## Sources

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

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