Summary
azureauthextension's Azure Authenticator Extension contains a server-side authentication bypass that accepts any Azure access token the collector's identity can mint, as long as it matches a token fetched using a Host-controlled scope.
Because bearer tokens are not validated as JWTs and are compared only by string equality against a server-side token derived from attacker-controlled input, an attacker with any valid Azure access token can authenticate to any OpenTelemetry receiver configured with auth: azure_auth.
Affected context
This vulnerability affects environments where:
- OpenTelemetry Collectors are deployed with the
azureauthextensionAzure Authenticator Extension between versions 0.124.0 and 0.150.0, and - One or more receivers are configured with
auth: azure_auth, and - The collector's identity (managed identity, service principal, or similar) can obtain Azure access tokens for multiple resource scopes (e.g., ARM, Microsoft Graph, Key Vault, Storage).
In such setups, the extension's Authenticate method compares the client's bearer token to a newly minted token using a scope derived from the client-supplied Host header, without validating the token as a JWT. This creates a situation where any valid token for any resource that the identity can access may be treated as valid for the telemetry endpoint, depending on how the Host header is chosen.
Exploit preconditions
- Attack surface: Any OpenTelemetry Collector endpoint exposed over the network that uses
auth: azure_authfor authentication (e.g., OTLP/gRPC or HTTP receivers). - Required access: Ability to:
- Acquire at least one valid Azure access token for any resource the collector's configured identity can mint tokens for (e.g., ARM, Graph, Key Vault, Storage), and
- Send HTTP/gRPC requests to the exposed collector endpoint, controlling the
Hostheader andAuthorization: Bearertoken. - Trigger point: A client request to a protected receiver where the extension's
Authenticatemethod:
- Reads the bearer token from the client.
- Uses its configured credential to obtain a token whose scope is derived from the client-controlled
Hostheader. - Compares the server-side token and client token using string equality.
- Why exploitation is possible:
- No JWT structure, signature, or claims validation is performed (CWE-347).
- Authentication logic relies on comparing token strings rather than validating their intended audience, issuer, or scope (CWE-287, CWE-290).
- The resource/scope for the server-side token request is derived from the untrusted
Hostheader (CWE-294), making it possible for an attacker to select a scope that matches a token they already possess. - Tokens are replayable for their full issued lifetime, which is often several hours, increasing the practical attack window.
Why this happens
The core issue stems from treating opaque bearer tokens as simple secrets and validating them via string comparison instead of as structured, signed security tokens.
Specifically, the Authenticate method:
- Does not parse the incoming bearer token as a JWT or validate its signature, issuer, audience, expiry, or scopes (CWE-347: Improper Verification of Cryptographic Signature).
- Uses its own configured credential to obtain an access token with a scope derived directly from the untrusted
Hostheader (CWE-294: Authentication Bypass by Capture-replay, and misuse of network headers for security context). - Compares the client token and server-minted token using direct string equality, implicitly assuming that "matching bytes" imply correct identity and intended audience (CWE-287: Improper Authentication, CWE-290: Authentication Bypass by Spoofing).
Because the collector's identity can mint tokens for multiple Azure resources, any valid token that matches one of these server-side tokens becomes a universal key for authenticating to the collector whenever the attacker chooses a compatible Host. This logic fails to bind tokens to their intended resource or caller and ignores core authentication properties such as audience restriction and proof-of-possession.
Potential impact
- Unauthorized authentication to OpenTelemetry receivers that rely on
auth: azure_auth. - Ingestion of malicious or fabricated telemetry data, potentially polluting observability pipelines and downstream analytics.
- Exfiltration or observation of telemetry streams if receivers expose bidirectional or query-like capabilities.
- Lateral movement within observability infrastructure, using compromised telemetry endpoints as a stepping stone to other internal systems.
- Abuse of long-lived, replayable access tokens to maintain unauthorized access over time.
General mitigation guidance
Effective mitigation relies on enforcing proper token validation semantics and removing trust in client-controlled header-derived scopes:
- Use token validation libraries or platform SDKs that:
- Parse bearer tokens as JWTs or appropriate token formats,
- Verify signatures against trusted issuers,
- Enforce intended audience, resource, and scope constraints,
- Check expiry and revocation indicators where available.
- Decouple server-side token acquisition from client-controlled fields such as
Host. Any resource/scope used to validate a token should be derived from trusted configuration, not from incoming requests. - Treat bearer tokens as credentials bound to a specific resource or audience, not as generic shared secrets that can be reused across services.
- Apply least-privilege to the identity used by the collector, limiting the set of Azure resources for which it can mint tokens to only what is operationally necessary.
- Restrict network exposure of OpenTelemetry Collector endpoints, placing them behind authenticated, well-validated frontends or service meshes whenever feasible.
- Prefer secure-by-default authentication modules or middleware that encapsulate token verification logic, rather than custom comparison-based checks.
How teams detect issues like this
Detection generally focuses on both code-level and runtime signals:
- Static analysis and code review:
- Flag any authentication code that:
- Compares access tokens or authorization headers using direct string equality.
- Derives security-critical scopes, audiences, or resources from untrusted headers such as
Host,X-Forwarded-Host, or query parameters. - Uses token acquisition APIs (e.g., Azure credential libraries) without subsequent independent validation of incoming tokens.
- Review authentication middleware for:
- Missing JWT parsing and signature verification.
- Absence of audience, issuer, and expiry checks.
- Configuration and deployment checks:
- Scan collector configurations for receivers using
auth: azure_authand prioritize review of those exposed beyond a trusted internal network. - Validate that identity and authorization policies for the collector's backing identity follow least-privilege principles.
- Runtime monitoring:
- Monitor collector logs for:
- Authentication successes from unexpected callers or network locations.
- Repeated use of identical bearer tokens across multiple connections over extended periods.
- Implement anomaly detection on telemetry ingestion patterns, e.g., unusual sources sending high volumes of data to authenticated receivers.
- Automated SAST/IAST tools and CI policies can be configured to detect improper token validation patterns and untrusted header usage in security-critical flows.

