Vulnerabilities in pkg:golang/go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego

PACKAGE
Advisory Identifier: GHSA-5r5m-65gx-7vrh
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-5r5m-65gx-7vrh CVE-2023-25151 HIGH otelhttp and otelbeego have DoS vulnerability for high cardinality metrics

CVE-2023-25151 at a Glance

CVE Identifier CVE-2023-25151
GHSA Identifier GHSA-5r5m-65gx-7vrh
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
Package Ecosystem Go
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (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.

go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp fixed: 0.39.0
Upgrade go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp to 0.39.0
go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego fixed: 0.39.0
Upgrade go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego to 0.39.0
Verify Direct and Transitive Dependencies

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

### Impact The [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. The `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. Pseudo-attack: ``` for infinite loop { r := generate_random_string() do_http_request("/some/path?random="+r) } ``` ### Patches - `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` - v0.39.0 - `go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego` - v0.39.0 [^1]: https://github.com/open-telemetry/opentelemetry-go/blob/6cb5718eaaed5c408c3bf4ad1aecee5c20ccdaa9/semconv/internal/v2/http.go#L202-L208

CVE-2023-25151 Affected Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp Versions

2 component(s)
Fixed Versions:
0.39.0
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?
CVE-2023-25151 is a security vulnerability in Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp involving otelhttp and otelbeego have DoS vulnerability for high cardinality metrics under CWE-400: Uncontrolled Resource Consumption.
Which Go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp versions are affected?
Affected versions include releases prior to 0.39.0 across affected packages: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp, go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego.
What version fixes CVE-2023-25151?
Upgrading to 0.39.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp affected?
Yes, go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp is affected in releases prior to 0.39.0. Upgrade your dependency to 0.39.0 or later.
Is go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego affected?
Yes, go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego is affected in releases prior to 0.39.0. Upgrade your dependency to 0.39.0 or later.
What is the CVSS score of CVE-2023-25151?
CVE-2023-25151 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-25151?
CVE-2023-25151 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Go dependencies for CVE-2023-25151?
Run the dependency tree command: 'inspect dependencies for go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}