CVE-2026-42151
Description
Prometheus is an open-source monitoring system and time series database. Prior to versions 3.5.3 and 3.11.3, the client_secret field in the Azure AD remote write OAuth configuration (storage/remote/azuread) was typed as string instead of Secret. Prometheus redacts fields of type Secret when serving the configuration via the /-/config HTTP API endpoint. Because the field was a plain string, the Azure OAuth client secret was exposed in plaintext to any user or process with access to that endpoint. This issue has been patched in versions 3.5.3 and 3.11.3.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/prometheus/prometheusGo | >= 0.45.2, < 0.311.3 | 0.311.3 |
Affected products
1Patches
226dae7f06b6aMerge pull request #18590 from roidelapluie/roidelapluie/azadsecret
2 files changed · +9 −7
storage/remote/azuread/azuread.go+3 −2 modified@@ -27,6 +27,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/google/uuid" "github.com/grafana/regexp" + config_util "github.com/prometheus/common/config" ) // Clouds. @@ -75,7 +76,7 @@ type OAuthConfig struct { ClientID string `yaml:"client_id,omitempty"` // ClientSecret is the clientSecret of the azure active directory application that is being used to authenticate. - ClientSecret string `yaml:"client_secret,omitempty"` + ClientSecret config_util.Secret `yaml:"client_secret,omitempty"` // TenantID is the tenantId of the azure active directory application that is being used to authenticate. TenantID string `yaml:"tenant_id,omitempty"` @@ -357,7 +358,7 @@ func newWorkloadIdentityTokenCredential(clientOpts *azcore.ClientOptions, worklo // newOAuthTokenCredential returns new OAuth token credential. func newOAuthTokenCredential(clientOpts *azcore.ClientOptions, oAuthConfig *OAuthConfig) (azcore.TokenCredential, error) { opts := &azidentity.ClientSecretCredentialOptions{ClientOptions: *clientOpts} - return azidentity.NewClientSecretCredential(oAuthConfig.TenantID, oAuthConfig.ClientID, oAuthConfig.ClientSecret, opts) + return azidentity.NewClientSecretCredential(oAuthConfig.TenantID, oAuthConfig.ClientID, string(oAuthConfig.ClientSecret), opts) } // newSDKTokenCredential returns new SDK token credential.
storage/remote/azuread/azuread_test.go+6 −5 modified@@ -25,18 +25,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/google/uuid" "github.com/prometheus/client_golang/prometheus/promhttp" + config_util "github.com/prometheus/common/config" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "go.yaml.in/yaml/v2" ) const ( - dummyAudience = "dummyAudience" - dummyClientID = "00000000-0000-0000-0000-000000000000" - dummyClientSecret = "Cl1ent$ecret!" - dummyTenantID = "00000000-a12b-3cd4-e56f-000000000000" - testTokenString = "testTokenString" + dummyAudience = "dummyAudience" + dummyClientID = "00000000-0000-0000-0000-000000000000" + dummyClientSecret config_util.Secret = "Cl1ent$ecret!" + dummyTenantID = "00000000-a12b-3cd4-e56f-000000000000" + testTokenString = "testTokenString" ) func testTokenExpiry() time.Time { return time.Now().Add(5 * time.Second) }
cb493a437beaMerge pull request #18587 from roidelapluie/roidelapluie/azadsecret-lts
2 files changed · +9 −7
storage/remote/azuread/azuread.go+3 −2 modified@@ -27,6 +27,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/google/uuid" "github.com/grafana/regexp" + config_util "github.com/prometheus/common/config" ) // Clouds. @@ -55,7 +56,7 @@ type OAuthConfig struct { ClientID string `yaml:"client_id,omitempty"` // ClientSecret is the clientSecret of the azure active directory application that is being used to authenticate. - ClientSecret string `yaml:"client_secret,omitempty"` + ClientSecret config_util.Secret `yaml:"client_secret,omitempty"` // TenantID is the tenantId of the azure active directory application that is being used to authenticate. TenantID string `yaml:"tenant_id,omitempty"` @@ -279,7 +280,7 @@ func newManagedIdentityTokenCredential(clientOpts *azcore.ClientOptions, managed // newOAuthTokenCredential returns new OAuth token credential. func newOAuthTokenCredential(clientOpts *azcore.ClientOptions, oAuthConfig *OAuthConfig) (azcore.TokenCredential, error) { opts := &azidentity.ClientSecretCredentialOptions{ClientOptions: *clientOpts} - return azidentity.NewClientSecretCredential(oAuthConfig.TenantID, oAuthConfig.ClientID, oAuthConfig.ClientSecret, opts) + return azidentity.NewClientSecretCredential(oAuthConfig.TenantID, oAuthConfig.ClientID, string(oAuthConfig.ClientSecret), opts) } // newSDKTokenCredential returns new SDK token credential.
storage/remote/azuread/azuread_test.go+6 −5 modified@@ -25,18 +25,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/google/uuid" "github.com/prometheus/client_golang/prometheus/promhttp" + config_util "github.com/prometheus/common/config" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "gopkg.in/yaml.v2" ) const ( - dummyAudience = "dummyAudience" - dummyClientID = "00000000-0000-0000-0000-000000000000" - dummyClientSecret = "Cl1ent$ecret!" - dummyTenantID = "00000000-a12b-3cd4-e56f-000000000000" - testTokenString = "testTokenString" + dummyAudience = "dummyAudience" + dummyClientID = "00000000-0000-0000-0000-000000000000" + dummyClientSecret config_util.Secret = "Cl1ent$ecret!" + dummyTenantID = "00000000-a12b-3cd4-e56f-000000000000" + testTokenString = "testTokenString" ) func testTokenExpiry() time.Time { return time.Now().Add(5 * time.Second) }
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
7- github.com/prometheus/prometheus/pull/18587nvdIssue TrackingPatchWEB
- github.com/prometheus/prometheus/pull/18590nvdIssue TrackingPatchWEB
- github.com/advisories/GHSA-wg65-39gg-5wfjghsaADVISORY
- github.com/prometheus/prometheus/security/advisories/GHSA-wg65-39gg-5wfjnvdVendor AdvisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2026-42151ghsaADVISORY
- github.com/prometheus/prometheus/releases/tag/v3.11.3nvdRelease NotesWEB
- github.com/prometheus/prometheus/releases/tag/v3.5.3nvdRelease NotesWEB
News mentions
4- Patch Tuesday - May 2026Rapid7 Blog · May 13, 2026
- How Cloudflare responded to the “Copy Fail” Linux vulnerabilityCloudflare Blog · May 7, 2026
- The AI engineering stack we built internally — on the platform we shipCloudflare Blog · Apr 20, 2026
- Orchestrating AI Code Review at scaleCloudflare Blog · Apr 20, 2026