vulnerability
Red Hat OpenShift: CVE-2022-21698: prometheus/client_golang: Denial of service using InstrumentHandlerCounter
Severity | CVSS | Published | Added | Modified |
---|---|---|---|---|
5 | (AV:N/AC:L/Au:N/C:N/I:N/A:P) | Feb 15, 2022 | Jun 1, 2022 | Apr 11, 2025 |
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.
Solution(s)
References
- CVE-2022-21698
- https://attackerkb.com/topics/CVE-2022-21698
- REDHAT-RHSA-2022:1356
- REDHAT-RHSA-2022:1461
- REDHAT-RHSA-2022:1762
- REDHAT-RHSA-2022:2216
- REDHAT-RHSA-2022:2217
- REDHAT-RHSA-2022:2218
- REDHAT-RHSA-2022:2280
- REDHAT-RHSA-2022:4667
- REDHAT-RHSA-2022:4668
- REDHAT-RHSA-2022:5026
- REDHAT-RHSA-2022:5068
- REDHAT-RHSA-2022:5069
- REDHAT-RHSA-2022:5070
- REDHAT-RHSA-2022:6040
- REDHAT-RHSA-2022:6042
- REDHAT-RHSA-2022:6051
- REDHAT-RHSA-2022:6061
- REDHAT-RHSA-2022:6066
- REDHAT-RHSA-2022:6156
- REDHAT-RHSA-2022:6290
- REDHAT-RHSA-2022:6430
- REDHAT-RHSA-2022:6526
- REDHAT-RHSA-2022:6537
- REDHAT-RHSA-2022:7261
- REDHAT-RHSA-2022:7399
- REDHAT-RHSA-2022:7519
- REDHAT-RHSA-2022:7529
- REDHAT-RHSA-2022:8057
- REDHAT-RHSA-2022:9096
- REDHAT-RHSA-2023:0566
- REDHAT-RHSA-2023:0652
- REDHAT-RHSA-2023:1158
- REDHAT-RHSA-2023:1326
- REDHAT-RHSA-2023:2014
- REDHAT-RHSA-2023:5314
- REDHAT-RHSA-2024:0564
- REDHAT-RHSA-2024:2944
- REDHAT-RHSA-2024:4631

Explore Exposure Command
Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.