Skip to content
Heist/ feed
Back to feed
High

DoS vulnerability for high cardinality metrics in opentelemetry-go-contrib

Type: advisorySources: OSV

opentelemetry-go-contrib is a collection of extensions for OpenTelemetry-Go. The v0.38.0 release of `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` uses the `httpconv.ServerRequest` 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. This issue has been addressed in version 0.39.0. Users are advised to upgrade. There are no known workarounds for this issue.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2023-25151
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 15:36 UTC · Revision 1

Source evidence

DoS vulnerability for high cardinality metrics in opentelemetry-go-contrib

core-osv · Original source

Published 8 Feb 2023, 19:21 UTC

opentelemetry-go-contrib is a collection of extensions for OpenTelemetry-Go. The v0.38.0 release of `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` uses the `httpconv.ServerRequest` 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. This issue has been addressed in version 0.39.0. Users are advised to upgrade. There are no known workarounds for this issue.

osv:CVE-2023-25151
Complete source record
{
  "id": "4f220f4e32ccdd2d54f51d861100a90737ccb0fd49e79774b1b199c3c22156e1",
  "url": "https://osv.dev/vulnerability/CVE-2023-25151",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DoS vulnerability for high cardinality metrics in opentelemetry-go-contrib",
    "summary": "opentelemetry-go-contrib is a collection of extensions for OpenTelemetry-Go. The v0.38.0 release of `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` uses the `httpconv.ServerRequest` 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. This issue has been addressed in version 0.39.0. Users are advised to upgrade. There are no known workarounds for this issue.",
    "evidence": "osv:CVE-2023-25151",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2023-25151",
      "aliases": [
        "CVE-2023-25151",
        "GHSA-5r5m-65gx-7vrh",
        "GO-2023-1546"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/open-telemetry/opentelemetry-go-contrib",
              "type": "GIT",
              "events": [
                {
                  "introduced": "538baec1f9c565a3c6557eda86474406ab5d69d0"
                },
                {
                  "fixed": "0a2a048d07139eef24f25e6d8646f92a8c2f059f"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0.38.0"
                      },
                      {
                        "fixed": "0.39.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "cpe": "cpe:2.3:a:linuxfoundation:opentelemetry-go_contrib:0.38.0:*:*:*:*:opentelemetry-go:*:*",
                    "range": [
                      {
                        "introduced": "0.38.0"
                      },
                      {
                        "last_affected": "0.38.0"
                      }
                    ],
                    "source": "CPE_STRING"
                  }
                ]
              }
            }
          ],
          "versions": [
            "0.38.0",
            "zpages/v0.38.0",
            "v1.13.0",
            "tools/v1.13.0",
            "samplers/probability/consistent/v0.7.0",
            "samplers/jaegerremote/v0.7.0",
            "samplers/jaegerremote/example/v0.7.0",
            "samplers/aws/xray/v0.7.0",
            "propagators/ot/v1.13.0",
            "propagators/opencensus/v0.38.0",
            "propagators/opencensus/examples/v0.38.0",
            "propagators/jaeger/v1.13.0",
            "propagators/b3/v1.13.0",
            "propagators/aws/v1.13.0",
            "propagators/autoprop/v0.38.0",
            "instrumentation/runtime/v0.38.0",
            "instrumentation/runtime/example/v0.38.0",
            "instrumentation/net/http/otelhttp/v0.38.0",
            "instrumentation/net/http/otelhttp/test/v0.38.0",
            "instrumentation/net/http/otelhttp/example/v0.38.0",
            "instrumentation/net/http/httptrace/otelhttptrace/v0.38.0",
            "instrumentation/net/http/httptrace/otelhttptrace/test/v0.38.0",
            "instrumentation/net/http/httptrace/otelhttptrace/example/v0.38.0",
            "instrumentation/host/v0.38.0",
            "instrumentation/host/example/v0.38.0",
            "instrumentation/gopkg.in/macaron.v1/otelmacaron/v0.38.0",
            "instrumentation/gopkg.in/macaron.v1/otelmacaron/test/v0.38.0",
            "instrumentation/gopkg.in/macaron.v1/otelmacaron/example/v0.38.0",
            "instrumentation/google.golang.org/grpc/otelgrpc/v0.38.0",
            "instrumentation/google.golang.org/grpc/otelgrpc/test/v0.38.0",
            "instrumentation/google.golang.org/grpc/otelgrpc/example/v0.38.0",
            "instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/v0.38.0",
            "instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/test/v0.38.0",
            "instrumentation/github.com/labstack/echo/otelecho/v0.38.0",
            "instrumentation/github.com/labstack/echo/otelecho/test/v0.38.0",
            "instrumentation/github.com/labstack/echo/otelecho/example/v0.38.0",
            "instrumentation/github.com/gorilla/mux/otelmux/v0.38.0",
            "instrumentation/github.com/gorilla/mux/otelmux/test/v0.38.0",
            "instrumentation/github.com/gorilla/mux/otelmux/example/v0.38.0",
            "instrumentation/github.com/gocql/gocql/otelgocql/v0.38.0",
            "instrumentation/github.com/gocql/gocql/otelgocql/test/v0.38.0",
            "instrumentation/github.com/gocql/gocql/otelgocql/example/v0.38.0",
            "instrumentation/github.com/go-kit/kit/otelkit/v0.38.0",
            "instrumentation/github.com/go-kit/kit/otelkit/test/v0.38.0",
            "instrumentation/github.com/go-kit/kit/otelkit/example/v0.38.0",
            "instrumentation/github.com/gin-gonic/gin/otelgin/v0.38.0",
            "instrumentation/github.com/gin-gonic/gin/otelgin/test/v0.38.0",
            "instrumentation/github.com/gin-gonic/gin/otelgin/example/v0.38.0",
            "instrumentation/github.com/emicklei/go-restful/otelrestful/v0.38.0",
            "instrumentation/github.com/emicklei/go-restful/otelrestful/test/v0.38.0",
            "instrumentation/github.com/emicklei/go-restful/otelrestful/example/v0.38.0",
            "instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/v0.38.0",
            "instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/test/v0.38.0",
            "instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/v0.38.0",
            "instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/v0.38.0",
            "instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/v0.38.0",
            "instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/v0.38.0",
            "instrumentation/github.com/aws/aws-lambda-go/otellambda/xrayconfig/v0.38.0",
            "instrumentation/github.com/aws/aws-lambda-go/otellambda/v0.38.0",
            "instrumentation/github.com/aws/aws-lambda-go/otellambda/test/v0.38.0",
            "instrumentation/github.com/aws/aws-lambda-go/otellambda/example/v0.38.0",
            "instrumentation/github.com/astaxie/beego/otelbeego/v0.38.0",
            "instrumentation/github.com/astaxie/beego/otelbeego/test/v0.38.0",
            "instrumentation/github.com/astaxie/beego/otelbeego/example/v0.38.0",
            "instrumentation/github.com/Shopify/sarama/otelsarama/v0.38.0",
            "instrumentation/github.com/Shopify/sarama/otelsarama/test/v0.38.0",
            "instrumentation/github.com/Shopify/sarama/otelsarama/example/v0.38.0",
            "detectors/gcp/v1.13.0",
            "detectors/aws/lambda/v0.38.0",
            "detectors/aws/eks/v1.13.0",
            "detectors/aws/ecs/v1.13.0",
            "detectors/aws/ec2/v1.13.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-25151.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:37.050481621Z",
      "provider": "osv",
      "references": [
        "https://github.com/open-telemetry/opentelemetry-go/blob/v1.12.0/semconv/internal/v2/http.go#L159",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/25xxx/CVE-2023-25151.json",
        "https://github.com/open-telemetry/opentelemetry-go-contrib/security/advisories/GHSA-5r5m-65gx-7vrh",
        "https://nvd.nist.gov/vuln/detail/CVE-2023-25151"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-400"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/25xxx/CVE-2023-25151.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-25151",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 504187,
  "published_at": "2023-02-08T19:21:37.401+00:00"
}