CVE-2023-45142
HIGHOpenTelemetry-Go Contrib has DoS vulnerability in otelhttp due to unbound cardinality metrics
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Blast Radius
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp🐹go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful🐹go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin🐹go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux🐹go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho🐹go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron🐹go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptraceReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
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 Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | all versions | 0.44.0 |
| 🐹Go | go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful | all versions | 0.44.0 |
| 🐹Go | go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin | all versions | 0.44.0 |
| 🐹Go | go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux | all versions | 0.44.0 |
| 🐹Go | go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho | all versions | 0.44.0 |
| 🐹Go | go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron | all versions | 0.44.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp to 0.44.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2023-45142 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether CVE-2023-45142 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to CVE-2023-45142. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2023-45142 in your dependencies?
O3 detects CVE-2023-45142 across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.