CVE-2023-45142
OpenTelemetry-Go Contrib has DoS vulnerability in otelhttp due to unbound cardinality metrics
Also known as GHSA-rcjv-mgp8-qvmr, GO-2023-2113
Mitigation
- Upgrade go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp to 0.44.0 or later.
- Upgrade go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful to 0.44.0 or later.
- Upgrade go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin to 0.44.0 or later.
- Upgrade go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux to 0.44.0 or later.
- Upgrade go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho to 0.44.0 or later.
- Upgrade go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron to 0.44.0 or later.
- Upgrade go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace to 0.44.0 or later.
Who should check
- Projects that depend on Go package go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp (< 0.44.0)
- Projects that depend on Go package go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful (< 0.44.0)
- Projects that depend on Go package go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin (< 0.44.0)
- Projects that depend on Go package go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux (< 0.44.0)
- Projects that depend on Go package go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho (< 0.44.0)
- Projects that depend on Go package go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron (< 0.44.0)
- Projects that depend on Go package go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace (< 0.44.0)
- Anyone running open-telemetry opentelemetry-go-contrib < 0.44.0
Vulnerability facts
- Affected
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp < 0.44.0; go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful < 0.44.0; go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin < 0.44.0; go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux < 0.44.0; go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho < 0.44.0; go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron < 0.44.0; go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace < 0.44.0
- Fixed in
- 0.44.0
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 7.5 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: None
- Availability impact: High
- EPSS
- 1.73% chance of exploitation in 30 days (percentile 78, 2026-11-26)
- CWE
- CWE-770
- Modified
Description
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Go go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | < 0.44.0 | 0.44.0 | osv |
| Go go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful | < 0.44.0 | 0.44.0 | osv |
| Go go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin | < 0.44.0 | 0.44.0 | osv |
| Go go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux | < 0.44.0 | 0.44.0 | osv |
| Go go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho | < 0.44.0 | 0.44.0 | osv |
| Go go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron | < 0.44.0 | 0.44.0 | osv |
| Go go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace | < 0.44.0 | 0.44.0 | osv |
| open-telemetry opentelemetry-go-contrib | < 0.44.0 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2023-45142. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2023-45142.md Affected: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp < 0.44.0; go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful < 0.44.0; go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin < 0.44.0; go.opentelemetry.io/contrib/instrumentation… Fixed in: 0.44.0 Steps: 1. Search this machine and project for go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp (Go), go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful (Go), go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin (Go), go.opentelemetry.io/contrib/instrumentation/github.com/…: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Other
- 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/
- https://github.com/open-telemetry/opentelemetry-go-contrib
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2UTRJ54INZG3OC2FTAN6AFB2RYNY2GAD
FAQ
Is CVE-2023-45142 being exploited?
There is no confirmed exploitation: CVE-2023-45142 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.73% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2023-45142?
High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2023-45142?
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp < 0.44.0; go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful < 0.44.0; go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin < 0.44.0; go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux < 0.44.0; go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho < 0.44.0; go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron < 0.44.0; go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace < 0.44.0.
Is there a fix for CVE-2023-45142?
Yes. Fixed in 0.44.0. Upgrade go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp to 0.44.0 or later. Upgrade go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful to 0.44.0 or later. Upgrade go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin to 0.44.0 or later. Upgrade go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux to 0.44.0 or later. Upgrade go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho to 0.44.0 or later. Upgrade go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron to 0.44.0 or later. Upgrade go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace to 0.44.0 or later.
How do I check if I'm affected by CVE-2023-45142?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.