CVE-2023-45142OpenTelemetry-Go Contrib has DoS vulnerability in otelhttp due to unbound cardinality…
OpenTelemetry-Go Contrib is a collection of third-party packages for OpenTelemetry-Go. A handler wrapper out of the box adds labels `http.user_agent` and `http.method` that have unbound cardinality. It leads to the server's potential memory exhaustion when many malicious requests are sent to it. HTTP header User-Agent or HTTP method for requests can be easily set by an attacker to be random and long. The library internally uses `httpconv.ServerRequest` that records every value for HTTP `method` and `User-Agent`. In order to be affected, a program has to use the `otelhttp.NewHandler` wrapper and not filter any unknown HTTP methods or User agents on the level of CDN, LB, previous middleware, etc. Version 0.44.0 fixed this issue when the values collected for attribute `http.request.method` were changed to be restricted to a set of well-known values and other high cardinality attributes were removed. As a workaround to stop being affected, `otelhttp.WithFilter()` can be used, but it requires manual careful configuration to not log certain requests entirely. For convenience and safe usage of this library, it should by default mark with the label `unknown` non-standard HTTP methods and User agents to show that such requests were made but do not increase cardinality. In case someone wants to stay with the current behavior, library API should allow to enable it.
What to do
Fixed builds are available from Alpine, Go: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | golang-opentelemetry-contrib | Fix pending | UBUNTU-CVE-2023-45142 | |
| Ubuntu 26.04 | golang-opentelemetry-contrib | Under investigation | UBUNTU-CVE-2023-45142 | |
| Ubuntu 25.10 | golang-opentelemetry-contrib | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-45142 | |
| Alpine Linux 3.24 | k3s | Fixed | 1.29.3.1-r0 | ALPINE-CVE-2023-45142 |
| Alpine Linux 3.23 | k3s | Fixed | 1.29.3.1-r0 | ALPINE-CVE-2023-45142 |
| Alpine Linux 3.22 | k3s | Fixed | 1.29.3.1-r0 | ALPINE-CVE-2023-45142 |
| Alpine Linux 3.21 | k3s | Fixed | 1.29.3.1-r0 | ALPINE-CVE-2023-45142 |
| Alpine Linux 3.20 | k3s | Fixed | 1.29.3.1-r0 | ALPINE-CVE-2023-45142 |
| Go library | github.com/prometheus/client_golang | Fixed | 1.11.1 | GO-2022-0322 |
| Go library | go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego | Fixed | 0.39.0 | GHSA-5r5m-65gx-7vrh |
| Go library | go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful | Fixed | 0.44.0 | GO-2023-2113 |
| Go library | go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin | Fixed | 0.44.0 | GO-2023-2113 |
| Go library | go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux | Fixed | 0.44.0 | GO-2023-2113 |
| Go library | go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho | Fixed | 0.44.0 | GHSA-rcjv-mgp8-qvmr |
| Go library | go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron | Fixed | 0.44.0 | GHSA-rcjv-mgp8-qvmr |
| Go library | go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace | Fixed | 0.44.0 | GO-2023-2113 |
| Go library | go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | Fixed | 0.39.0 | GO-2023-1546 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- open-telemetry opentelemetry-go-contrib: affected: < 0.44.0
References
- https://github.com/open-telemetry/opentelemetry-go-contrib/security/advisories/GHSA-rcjv-mgp8-qvmr
- https://github.com/open-telemetry/opentelemetry-go-contrib/security/advisories/GHSA-5r5m-65gx-7vrh
- https://github.com/open-telemetry/opentelemetry-go-contrib/pull/4277
- https://github.com/advisories/GHSA-cg3q-j54f-5p7p
- https://github.com/open-telemetry/opentelemetry-go-contrib/blob/5f7e6ad5a49b45df45f61a1deb29d7f1158032df/instrumentation/net/http/otelhttp/handler.go#L63-L65
- https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.19.0
- https://github.com/open-telemetry/opentelemetry-go/blob/38e1b499c3da3107694ad2660b3888eee9c8b896/semconv/internal/v2/http.go#L223
- https://github.com/open-telemetry/opentelemetry-go/blob/v1.12.0/semconv/internal/v2/http.go#L159
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2UTRJ54INZG3OC2FTAN6AFB2RYNY2GAD/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.