Summary
A configuration typing issue in Prometheus caused the Azure AD remote write OAuth client_secret to be treated as a plain string instead of a redacted secret.
As a result, the OAuth client secret could be exposed in cleartext via the /-/config HTTP API endpoint to any user or process that could reach that endpoint.
Affected context
This vulnerability appears in Prometheus deployments that:
- Use the Azure AD remote write OAuth configuration (
storage/remote/azuread), and - Expose or rely on the
/-/configHTTP endpoint for configuration inspection or monitoring.
In these setups, the client_secret was modeled as a plain string rather than a secret type, so Prometheus did not redact it when rendering configuration via the HTTP API. Any operator, service, or monitoring tool with HTTP access to /-/config could potentially view the Azure OAuth client secret in plaintext.
Exploit preconditions
- Attack surface: Prometheus
/-/configHTTP endpoint. - Required access: Network access to the Prometheus HTTP server with permission to reach the
/-/configpath (often not authenticated in default or internal-only setups). - Trigger point: An HTTP GET request to the
/-/configendpoint while Azure AD remote write OAuth is configured with aclient_secret. - Why exploitation is possible: The
client_secretfield was typed as a regular string, so Prometheus' automatic redaction for fields of typeSecretdid not apply, resulting in the secret being serialized and served in cleartext.
Why this happens
The root cause is an incorrect data classification and type assignment for a sensitive configuration value. In Prometheus' configuration model, fields marked as Secret are automatically redacted when exposed via diagnostic HTTP endpoints. The Azure AD remote write OAuth client_secret field was erroneously defined as a plain string instead of a Secret.
This maps primarily to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, and is closely related to CWE-312: Cleartext Storage of Sensitive Information, because a sensitive credential was treated as non-sensitive data and presented in cleartext where redaction should have been enforced.
Potential impact
- Unauthorized disclosure of the Azure AD OAuth client secret used for remote write.
- Abuse of the exposed client secret to impersonate Prometheus or another trusted client to Azure AD–protected endpoints.
- Potential unauthorized data access or modification in systems that trust the compromised OAuth client.
- Facilitation of lateral movement if the same secret or client application is reused across environments.
- Loss of confidentiality for internal monitoring and infrastructure credentials.
General mitigation guidance
Effective mitigation focuses on ensuring secrets are consistently handled as sensitive values and minimizing their observable surface:
- Use strongly typed secret abstractions for credentials and keys so that redaction and access controls apply automatically.
- Limit exposure of diagnostic and configuration endpoints (such as
/-/config) to tightly controlled, authenticated, and authorized users or networks. - Apply the principle of least privilege to OAuth applications and secrets so that compromise has minimal downstream impact.
- Centralize secret management so that sensitive values are not casually embedded or mirrored in multiple configuration views or services.
- Periodically rotate credentials exposed by such issues to reduce the window of impact if they are leaked.
How teams detect issues like this
Security and operations teams can detect similar issues using:
- Code and configuration review: Verify that all credential-like fields (e.g., secret, token, password, key) are modeled using secret-aware types or abstractions, and are excluded or redacted from public diagnostics.
- Static analysis checks: Enforce rules that flag configuration models or structs where sensitive-sounding fields are typed as generic strings or included in HTTP responses without redaction.
- Runtime inspection: Periodically query diagnostic endpoints (like
/-/config) in a controlled environment and scan responses for patterns resembling secrets (long random strings, known prefixes, etc.). - Policy enforcement: Use infrastructure and API gateways to restrict or authenticate access to internal configuration endpoints and to log access for auditing purposes.

