golang-github-prometheus-client-golang — security advisory
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.
- Products
- golang-github-prometheus-client-golang
- Affected versions
- 0.8.0-1, 0.8.0-2, 0.9.2-0ubuntu3, 1.11.0-3, 1.16.0-4, 1.17.0-2, 1.18.0-2, 1.18.0-3, 1.21.1-1, 1.23.2-1ubuntu1, 1.23.2-3, 1.23.2-4, 1.9.0-2
- Fixed versions
- Not specified
- CVEs
- CVE-2022-21698
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 00:45 UTC · Revision 1
Source evidence
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.
osv:UBUNTU-CVE-2022-21698
golang-github-prometheus-client-golang
Fixed versions: Not specified
golang-github-prometheus-client-golang
Fixed versions: Not specified
golang-github-prometheus-client-golang
Fixed versions: Not specified
golang-github-prometheus-client-golang
Fixed versions: Not specified
golang-github-prometheus-client-golang
Fixed versions: Not specified
golang-github-prometheus-client-golang
Fixed versions: Not specified
golang-github-prometheus-client-golang
Fixed versions: Not specified
Complete source record
{
"id": "0a647bcf6451a01eac98ca30c23e848520351873d547ecd468a36e24de646368",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2022-21698",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2022-21698",
"summary": "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.",
"evidence": "osv:UBUNTU-CVE-2022-21698",
"products": [
{
"name": {
"value": "golang-github-prometheus-client-golang",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.8.0-1",
"evidence": "/affected/0/versions"
},
{
"value": "0.8.0-2",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "golang-github-prometheus-client-golang",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.9.2-0ubuntu3",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "golang-github-prometheus-client-golang",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.9.0-2",
"evidence": "/affected/2/versions"
},
{
"value": "1.11.0-3",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "golang-github-prometheus-client-golang",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.16.0-4",
"evidence": "/affected/3/versions"
},
{
"value": "1.17.0-2",
"evidence": "/affected/3/versions"
},
{
"value": "1.18.0-2",
"evidence": "/affected/3/versions"
},
{
"value": "1.18.0-3",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "golang-github-prometheus-client-golang",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.21.1-1",
"evidence": "/affected/4/versions"
}
]
},
{
"name": {
"value": "golang-github-prometheus-client-golang",
"evidence": "/affected/5/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.23.2-1ubuntu1",
"evidence": "/affected/5/versions"
},
{
"value": "1.23.2-3",
"evidence": "/affected/5/versions"
},
{
"value": "1.23.2-4",
"evidence": "/affected/5/versions"
}
]
},
{
"name": {
"value": "golang-github-prometheus-client-golang",
"evidence": "/affected/6/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.21.1-1",
"evidence": "/affected/6/versions"
},
{
"value": "1.23.2-1ubuntu1",
"evidence": "/affected/6/versions"
}
]
}
],
"severity": "high",
"structured": {
"id": "UBUNTU-CVE-2022-21698",
"aliases": [
"UBUNTU-CVE-2022-21698"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
},
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-prometheus-client-golang",
"purl": "pkg:deb/ubuntu/golang-github-prometheus-client-golang?arch=source&distro=bionic",
"ecosystem": "Ubuntu:18.04:LTS"
},
"versions": [
"0.8.0-1",
"0.8.0-2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-21698.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-prometheus-client-golang-dev",
"binary_version": "0.8.0-2"
},
{
"binary_name": "golang-prometheus-client-dev",
"binary_version": "0.8.0-2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-prometheus-client-golang",
"purl": "pkg:deb/ubuntu/golang-github-prometheus-client-golang?arch=source&distro=focal",
"ecosystem": "Ubuntu:20.04:LTS"
},
"versions": [
"0.9.2-0ubuntu3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-21698.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-prometheus-client-golang-dev",
"binary_version": "0.9.2-0ubuntu3"
},
{
"binary_name": "golang-prometheus-client-dev",
"binary_version": "0.9.2-0ubuntu3"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-prometheus-client-golang",
"purl": "pkg:deb/ubuntu/golang-github-prometheus-client-golang?arch=source&distro=jammy",
"ecosystem": "Ubuntu:22.04:LTS"
},
"versions": [
"1.9.0-2",
"1.11.0-3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-21698.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-prometheus-client-golang-dev",
"binary_version": "1.11.0-3"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-prometheus-client-golang",
"purl": "pkg:deb/ubuntu/golang-github-prometheus-client-golang?arch=source&distro=noble",
"ecosystem": "Ubuntu:24.04:LTS"
},
"versions": [
"1.16.0-4",
"1.17.0-2",
"1.18.0-2",
"1.18.0-3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-21698.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-prometheus-client-golang-dev",
"binary_version": "1.18.0-3"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-prometheus-client-golang",
"purl": "pkg:deb/ubuntu/golang-github-prometheus-client-golang?arch=source&distro=questing",
"ecosystem": "Ubuntu:25.10"
},
"versions": [
"1.21.1-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-21698.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-prometheus-client-golang-dev",
"binary_version": "1.21.1-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-prometheus-client-golang",
"purl": "pkg:deb/ubuntu/golang-github-prometheus-client-golang?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"1.23.2-1ubuntu1",
"1.23.2-3",
"1.23.2-4"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-21698.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-prometheus-client-golang-dev",
"binary_version": "1.23.2-4"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "golang-github-prometheus-client-golang",
"purl": "pkg:deb/ubuntu/golang-github-prometheus-client-golang?arch=source&distro=resolute",
"ecosystem": "Ubuntu:26.04:LTS"
},
"versions": [
"1.21.1-1",
"1.23.2-1ubuntu1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-21698.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "golang-github-prometheus-client-golang-dev",
"binary_version": "1.23.2-1ubuntu1"
}
]
}
}
],
"modified": "2026-10-17T12:56:01.854797433Z",
"provider": "osv",
"upstream": [
"CVE-2022-21698"
],
"references": [
"https://ubuntu.com/security/CVE-2022-21698",
"https://github.com/prometheus/client_golang/security/advisories/GHSA-cg3q-j54f-5p7p",
"https://github.com/prometheus/client_golang/pull/962",
"https://github.com/prometheus/client_golang/pull/987",
"https://github.com/prometheus/client_golang/releases/tag/v1.11.1",
"https://www.cve.org/CVERecord?id=CVE-2022-21698"
]
},
"related_cves": [
{
"value": "CVE-2022-21698",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 354618,
"published_at": "2022-02-15T16:15:00+00:00"
}