CVE-2023-25151: Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp Denial of Service Vulnerability
HIGHCVE-2023-25151 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp libraries in the Go ecosystem. The issue involves otelhttp and otelbeego have dos vulnerability for high cardinality metrics. Remediation is available by upgrading affected packages to version 0.39.0.
CVE-2023-25151 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2023-25151
To remediate this vulnerability, upgrade all affected Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp to 0.39.0
Upgrade go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego to 0.39.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-25151, inspect your project dependencies for Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp:
inspect dependencies for go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
Analyze the terminal output to locate any version of Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.39.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-25151 Affected Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
|
Go |
≥ 0.38.0
< 0.39.0
|
0.39.0
|
|
go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego
|
Go |
≥ 0.38.0
< 0.39.0
|
0.39.0
|
References
Frequently Asked Questions
What is CVE-2023-25151?
Which Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp versions are affected?
What version fixes CVE-2023-25151?
Is go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp affected?
Is go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego affected?
What is the CVSS score of CVE-2023-25151?
What CWE is associated with CVE-2023-25151?
How can I check Go dependencies for CVE-2023-25151?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5r5m-65gx-7vrh",
"modified" : "2023-06-13T23:47:42Z",
"published" : "2023-02-08T22:32:16Z",
"aliases" : [ "CVE-2023-25151" ],
"summary" : "otelhttp and otelbeego have DoS vulnerability for high cardinality metrics",
"details" : "### Impact\n\nThe [v0.38.0](https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.13.0) release of [`go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp`](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/463c2e7cd69d25f40b0a595b05394eeb26c68ae2/instrumentation/net/http/otelhttp/handler.go#L218) uses the [`httpconv.ServerRequest`](https://github.com/open-telemetry/opentelemetry-go/blob/v1.12.0/semconv/internal/v2/http.go#L159) function to annotate metric measurements for the `http.server.request_content_length`, `http.server.response_content_length`, and `http.server.duration` instruments.\n\nThe `ServerRequest` function sets the `http.target` attribute value to be the whole request URI (including the query string)[^1]. The metric instruments do not \"forget\" previous measurement attributes when `cumulative` temporality is used, this means the cardinality of the measurements allocated is directly correlated with the unique URIs handled. If the query string is constantly random, this will result in a constant increase in memory allocation that can be used in a denial-of-service attack.\n\nPseudo-attack:\n```\nfor infinite loop {\n r := generate_random_string()\n do_http_request(\"/some/path?random=\"+r)\n}\n```\n\n### Patches\n- `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` - v0.39.0\n- `go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego` - v0.39.0\n\n[^1]: https://github.com/open-telemetry/opentelemetry-go/blob/6cb5718eaaed5c408c3bf4ad1aecee5c20ccdaa9/semconv/internal/v2/http.go#L202-L208",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.38.0"
}, {
"fixed" : "0.39.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.38.0"
}, {
"fixed" : "0.39.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/open-telemetry/opentelemetry-go-contrib/security/advisories/GHSA-5r5m-65gx-7vrh"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-25151"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/open-telemetry/opentelemetry-go-contrib"
}, {
"type" : "WEB",
"url" : "https://github.com/open-telemetry/opentelemetry-go/blob/v1.12.0/semconv/internal/v2/http.go#L159"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-02-08T22:32:16Z",
"nvd_published_at" : "2023-02-08T20:15:00Z"
}
}