/

CVE-2026-42151

Severity:

HIGH RISK

(7.5)

Sensitive Data Exposure in Prometheus Azure AD Remote Write

CVE-2026-42151

Modified

Vulnerability type

Category:

Sensitive Data Exposure

CWE:

CWE-200, CWE-312, CWE-256

Impact:

Credential Disclosure / Sensitive Information Exposure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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 /-/config HTTP 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 /-/config HTTP endpoint.
  • Required access: Network access to the Prometheus HTTP server with permission to reach the /-/config path (often not authenticated in default or internal-only setups).
  • Trigger point: An HTTP GET request to the /-/config endpoint while Azure AD remote write OAuth is configured with a client_secret.
  • Why exploitation is possible: The client_secret field was typed as a regular string, so Prometheus' automatic redaction for fields of type Secret did 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.

Sources

SourceLink
github.comgithub.com/prometheus/prometheus/pull/18587
github.comgithub.com/prometheus/prometheus/pull/18590
github.comgithub.com/prometheus/prometheus/releases/tag/v3.11.3
github.comgithub.com/prometheus/prometheus/releases/tag/v3.5.3
github.comgithub.com/prometheus/prometheus/security/advisories/GHSA-wg65-39gg-5wfj
access.redhat.comaccess.redhat.com/errata/RHSA-2026:25039
access.redhat.comaccess.redhat.com/errata/RHSA-2026:25245
access.redhat.comaccess.redhat.com/errata/RHSA-2026:25504
access.redhat.comaccess.redhat.com/errata/RHSA-2026:34357
access.redhat.comaccess.redhat.com/errata/RHSA-2026:34359
access.redhat.comaccess.redhat.com/errata/RHSA-2026:36651
access.redhat.comaccess.redhat.com/errata/RHSA-2026:36796
access.redhat.comaccess.redhat.com/errata/RHSA-2026:36797
access.redhat.comaccess.redhat.com/errata/RHSA-2026:37267
access.redhat.comaccess.redhat.com/errata/RHSA-2026:37271
access.redhat.comaccess.redhat.com/errata/RHSA-2026:37272
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40118
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40262
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40768
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40945
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40970
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40972
access.redhat.comaccess.redhat.com/errata/RHSA-2026:40974
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41019
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41030
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41031
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41066
access.redhat.comaccess.redhat.com/errata/RHSA-2026:42146
access.redhat.comaccess.redhat.com/errata/RHSA-2026:42796
access.redhat.comaccess.redhat.com/errata/RHSA-2026:42852
access.redhat.comaccess.redhat.com/errata/RHSA-2026:43052
access.redhat.comaccess.redhat.com/errata/RHSA-2026:44622
access.redhat.comaccess.redhat.com/errata/RHSA-2026:47149
access.redhat.comaccess.redhat.com/errata/RHSA-2026:47952
access.redhat.comaccess.redhat.com/errata/RHSA-2026:50843
access.redhat.comaccess.redhat.com/errata/RHSA-2026:50874
access.redhat.comaccess.redhat.com/errata/RHSA-2026:53412
access.redhat.comaccess.redhat.com/errata/RHSA-2026:53413
access.redhat.comaccess.redhat.com/errata/RHSA-2026:53415
access.redhat.comaccess.redhat.com/errata/RHSA-2026:53530
access.redhat.comaccess.redhat.com/errata/RHSA-2026:54288
access.redhat.comaccess.redhat.com/errata/RHSA-2026:54427
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-42151
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2466507
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42151.json

Frequently asked

questions

Yes, if the Prometheus HTTP server and the /-/config endpoint are reachable from an attacker's network location. Anyone with HTTP access to that endpoint can potentially retrieve the configuration and see the client secret in cleartext.

It depends on how Prometheus is deployed. In many environments, internal Prometheus instances are accessible without strong authentication on diagnostic endpoints. If the /-/config endpoint is unprotected or reachable by untrusted parties, no additional authentication may be required.

Treat all credentials and sensitive tokens as first-class secrets in the data model, using dedicated secret types that are automatically redacted or excluded from logs and diagnostics. Avoid representing secrets as plain strings in any structure that may be serialized or exposed via HTTP or logs.

Establish a consistent secret-handling policy: classify sensitive fields explicitly, enforce type-based redaction in all debug and configuration endpoints, restrict access to those endpoints by default, and include automated checks in CI/CD pipelines to catch new fields that look like secrets but are not modeled as such.

Find out what's already
exploitable in your codebase.