{"id":"CVE-2022-21698","summary":"Uncontrolled Resource Consumption in promhttp","details":"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.","aliases":["GHSA-cg3q-j54f-5p7p","GO-2022-0322"],"modified":"2026-04-29T08:14:13.006855238Z","published":"2022-02-15T00:00:00Z","related":["ALSA-2022:1762","ALSA-2022:7519","ALSA-2022:7529","ALSA-2022:8057","CGA-8xhp-794r-624p","GO-2023-1546","GO-2023-2113","SUSE-RU-2022:2145-1","SUSE-SU-2022:1433-1","SUSE-SU-2022:1434-1","SUSE-SU-2022:1435-1","SUSE-SU-2022:1531-1","SUSE-SU-2022:1545-1","SUSE-SU-2022:2134-1","SUSE-SU-2022:2137-1","SUSE-SU-2022:2139-1","SUSE-SU-2022:2140-1","SUSE-SU-2022:2145-1","SUSE-SU-2022:2834-1","SUSE-SU-2022:2839-1","SUSE-SU-2022:2839-2","SUSE-SU-2022:3745-1","SUSE-SU-2022:3747-1","SUSE-SU-2024:0191-1","openSUSE-SU-2024:11965-1","openSUSE-SU-2024:12231-1","openSUSE-SU-2024:12259-1","openSUSE-SU-2024:12400-1","openSUSE-SU-2026:10634-1","openSUSE-SU-2026:10644-1"],"database_specific":{"cwe_ids":["CWE-400"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21698.json","cna_assigner":"GitHub_M"},"references":[{"type":"WEB","url":"https://github.com/prometheus/client_golang/releases/tag/v1.11.1"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21698.json"},{"type":"ADVISORY","url":"https://github.com/prometheus/client_golang/security/advisories/GHSA-cg3q-j54f-5p7p"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2IK53GWZ475OQ6ENABKMJMTOBZG6LXUR/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2PFW6Q2LXXWTFRTMTRN4ZGADFRQPKJ3D/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/36GUEPA5TPSC57DZTPYPBL6T7UPQ2FRH/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3L6GDN5S5QZSCFKWD3GKL2RDZQ6B4UWA/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4KDETHL5XCT6RZN2BBNOCEXRZ2W3SFU3/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5OGNAFVXSMTTT2UPH6CS3IH6L3KM42Q7/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7V7I72LSQ3IET3QJR6QPAVGJZ4CBDLN5/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AK7CJBCGERCRXYUR2EWDSSDVAQMTAZGX/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DLUJZV3HBP56ADXU6QH2V7RNYUPMVBXQ/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FY3N7H6VSDZM37B4SKM2PFFCUWU7QYWN/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HLAQRRGNSO5MYCPAXGPH2OCSHOGHSQMQ/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/J5WPM42UR6XIBQNQPNQHM32X7S4LJTRX/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KBMVIQFKQDSSTHVVJWJ4QH6TW3JVB7XZ/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MH6ALXEQXIFQRQFNJ5Y2MJ5DFPIX76VN/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RN7JGC2LVHPEGSJYODFUV5FEKPBVG4D7/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SASRKYHT5ZFSVMJUQUG3UAEQRJYGJKAR/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZKORFJTRRDJCWBTJPISKKCVMMMJBIRLG/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZY2SLWOQR4ZURQ7UBRZ7JIX6H6F5JHJR/"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21698"},{"type":"FIX","url":"https://github.com/prometheus/client_golang/pull/962"},{"type":"FIX","url":"https://github.com/prometheus/client_golang/pull/987"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/prometheus/client_golang","events":[{"introduced":"0"},{"fixed":"989baa30fe956631907493ccee1f8e7708660d96"}]}],"versions":["0.1.0","0.2.0","0.3.0","0.3.1","0.3.2","0.5.0","0.6.0","0.7.0","v0.8.0","v0.9.0","v0.9.0-pre1","v0.9.1","v0.9.2","v0.9.3","v0.9.4","v1.0.0","v1.1.0","v1.10.0","v1.11.0","v1.2.0","v1.2.1","v1.3.0","v1.4.0","v1.4.1","v1.5.0","v1.5.1","v1.6.0","v1.7.0","v1.7.1","v1.8.0","v1.9.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-21698.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}