OpenTelemetry-Go Contrib has DoS vulnerability in otelhttp due to unbound cardinality metrics
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 0.44.0
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
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.
Timeline
- CVE published
- Record last updated
Affected versions
- open-telemetry opentelemetry-go-contrib
fixed in 0.44.0
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttpGo
fixed in 0.44.0
- go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestfulGo
fixed in 0.44.0
- go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelginGo
fixed in 0.44.0
- go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmuxGo
fixed in 0.44.0
- go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelechoGo
fixed in 0.44.0
- go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaronGo
fixed in 0.44.0
- go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptraceGo
fixed in 0.44.0