CVE-2023-45142:
OpenTelemetry-Go Contrib vulnerable to denial of service in otelhttp due to unbound cardinality metrics
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.75486%
CWE
Published
10/16/2023
Updated
2/19/2024
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | go | < 0.44.0 | 0.44.0 |
go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful | go | < 0.44.0 | 0.44.0 |
go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin | go | < 0.44.0 | 0.44.0 |
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux | go | < 0.44.0 | 0.44.0 |
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho | go | < 0.44.0 | 0.44.0 |
go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron | go | < 0.44.0 | 0.44.0 |
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace | go | < 0.44.0 | 0.44.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability lies in the generation of metrics with unbound cardinality, specifically from 'http.method' and 'http.user_agent' attributes. The analysis focused on identifying functions that either generated these problematic attributes or consumed them for metrics recording prior to the patch.
- The
otelhttp.NewHandler
function is identified as it's the entry point for using the vulnerableotelhttp
middleware, as highlighted in the vulnerability description. - The
otelhttp.(*middleware).serveHTTP
function is identified as it's the core request handler inotelhttp
that, before the patch, usedsemconvutil.HTTPServerRequest
(which in turn calls(*httpConv).ServerRequest
) to get attributes for metrics. The patch changed this to use a new, safersemconvutil.HTTPServerRequestMetrics
. - The
(*httpConv).ServerRequest
function (present ininternal/semconvutil/httpconv.go
across multiple affected instrumentation packages) is identified as the generator of the high-cardinality attributes. The vulnerability description explicitly mentionshttpconv.ServerRequest
. The fix involved creating a new function(*httpConv).ServerRequestMetrics
that omits problematic attributes (likehttp.user_agent
) and sanitizes others (likehttp.method
viamethodMetric
) for metric purposes. The calling handlers were then updated to use this new function for metrics.
The evidence is drawn from the vulnerability description and the changes in the provided commit information, particularly the introduction of ServerRequestMetrics
and methodMetric
functions, and the modification of serveHTTP
to use the new metrics function. The functions listed are those that would be active in the runtime path when the vulnerability is triggered by processing HTTP requests and generating metrics from them.