Advisory

GHSA-4jvg-4jfx-fmhc

Also known as: CVE-2026-47256, GO-2026-5126

Summary

opentelemetry-collector-contrib sentryexporter: Path traversal in Sentry exporter via attacker-controlled service.name reaches privileged Sentry API endpoints with operator bearer token

Details

Summary

The Sentry exporter constructs Sentry API URLs by interpolating the span's service.name resource attribute into the URL path without validation. Because
service.name is controlled by remote OTLP senders and the operator-configured bearer token is attached to every request, a crafted service name can reach
arbitrary Sentry API endpoints reachable by that token — including privileged admin, organization, and member endpoints within the configured Sentry
organization.

Affected

  • exporter/sentryexporter/sentry_exporter.go (lines 715–737) — extractProjectSlug returns the attacker-controlled service.name directly as the slug.
  • exporter/sentryexporter/sentry_exporter.go (lines 745–809) — getOrCreateProjectEndpoint passes the raw slug to GetOTLPEndpoints at line 761.
  • exporter/sentryexporter/sentry_client.go (lines 190–244) — GetProjectKeys interpolates the slug into fmt.Sprintf URL path and attaches the operator bearer token on line 207.
  • exporter/sentryexporter/sentry_client.go (lines 327–363) — GetOTLPEndpoints calls GetProjectKeys on line 329 with the raw slug.
  • exporter/sentryexporter/config.go (lines 55–108) — projectSlugRegexp is applied only to operator config mappings inside validateRoutingConfig, never to runtime-derived slugs.

Root cause

  1. extractProjectSlug (sentry_exporter.go:715–737) reads service.name from pcommon.Resource.Attributes() without schema validation and returns the raw string on line 736.
  2. GetProjectKeys (sentry_client.go:192) calls fmt.Sprintf("%s/api/0/projects/%s/%s/keys/", c.baseURL, orgSlug, projectSlug). The slug is treated as a single path segment but no validation is performed.
  3. projectSlugRegexp (config.go:58) — defined as ^[a-z0-9_-]{1,50}$ — is referenced only inside validateRoutingConfig on line 98 (config-time only). No runtime callsite exists.
  4. Go net/http preserves literal .. and / characters in URL paths when constructed via fmt.Sprintf.
  5. The operator-configured DSN / bearer token is attached unconditionally to every outbound request (sentry_client.go:207): req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", c.authToken)).

Exploitation

Primary: query-string injection (reliable across all deployments)

Attacker emits service.name = "foo?injected_query=".

URL becomes https://sentry.io/api/0/projects/ORG-SLUG/foo?injected_query=/keys/.

The trailing /keys/ is consumed as part of the query string. The resource endpoint is /api/0/projects/ORG-SLUG/foo. The attacker can reach any GET-based
Sentry API endpoint reachable by the bearer token. This vector is not dependent on server-side path normalization and works in all deployment
configurations.

Secondary: path traversal (nginx-dependent)

Attacker emits a span with service.name = "foo/../../members".

Resulting URL: https://sentry.io/api/0/projects/ORG-SLUG/foo/../../members/keys/

After server-side normalization (nginx resolves .. segments): https://sentry.io/api/0/projects/ORG-SLUG/members/keys/

The operator bearer token authenticates the request. Effectiveness depends on whether the Sentry deployment normalizes .. segments before routing (standard
nginx behaviour).

Amplified: telemetry redirect for data exfiltration

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-06-18 15:04 UTC
Modified
2026-06-25 18:56 UTC

Affected packages and fixes

github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sentryexporter

Go · All systems

Affected

  • introduced 0, fixed 0.154.0 (semver)

Fixed versions

0.154.0

Fix

  • Fixed version 0.154.0
    go get github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences