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.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
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.
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 | 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 |
Linux distribution packages (37)
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 include 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.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
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 Command injection in ImageMagick
- CVE-2022-4170 Code injection in rxvt-unicode
- CVE-2022-40315 Moodle Minor SQL injection risk in admin user browsing
- CVE-2022-45152 Moodle blind Server-Side Request Forgery (SSRF) vulnerability in LTI provider library
- CVE-2022-24882 Server side NTLM does not properly check parameters in FreeRDP
All Fedoraproject Extra Packages for Enterprise Linux vulnerabilities
Sources
Also known as AZL-31981, AZL-33567, AZL-33603, AZL-33611, AZL-33614, AZL-33618 and 45 more.