Categories
CVE-2026-40179

Cross-Site Scripting (XSS) in github.com/prometheus/prometheus (CVE-2026-40179)

Summary

Cross-site scripting in github.com/prometheus/prometheus (CVE-2026-40179). Risk of unauthorized operations or information disclosure. Exploitable via innerHTML. Mitigation: upgrade to 2.7.2 or later.

Original description

The description as published by the source.

Prometheus is an open-source monitoring system and time series database. Versions 3.0 through 3.5.1 and 3.6.0 through 3.11.1 have stored cross-site scripting vulnerabilities in multiple components of the Prometheus web UI where metric names and label values are injected into innerHTML without escaping. In both the Mantine UI and old React UI, chart tooltips on the Graph page render metric names containing HTML/JavaScript without sanitization. In the old React UI, the Metric Explorer fuzzy search results use dangerouslySetInnerHTML without escaping, and heatmap cell tooltips interpolate le label values without sanitization. With Prometheus v3.x defaulting to UTF-8 metric and label name validation, characters like <, >, and " are now valid in metric names and labels. An attacker who can inject metrics via a compromised scrape target, remote write, or OTLP receiver endpoint can execute arbitrary JavaScript in the browser of any Prometheus user who views the metric in the Graph UI, potentially enabling configuration exfiltration, data deletion, or Prometheus shutdown depending on enabled flags. This issue has been fixed in versions 3.5.2 and 3.11.2. If developers are unable to immediately update, the following workarounds are recommended: ensure that the remote write receiver (--web.enable-remote-write-receiver) and the OTLP receiver (--web.enable-otlp-receiver) are not exposed to untrusted sources; verify that all scrape targets are trusted and not under attacker control; avoid…

Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-40179 has been found in github.com/prometheus/prometheus.
Attackers can target a specific entry point like innerHTML over the network to misuse the product.
Risk of unauthorized operations or information disclosure.
What to do: upgrade github.com/prometheus/prometheus to 2.7.2 or later.
If unsure, ask your IT team or search "github.com/prometheus/prometheus CVE-2026-40179" on the vendor's site.

CVE-2026-40179 (github.com/prometheus/prometheus) — CWE-79
Attack surface: innerHTML / labels.__name__ / dangerouslySetInnerHTML
Patched: 2.7.2 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

Cross-site scripting (XSS) (CWE-79) exists in github.com/prometheus/prometheus. Attackers reach the vulnerable code path via innerHTML.

📍 Affected scope

Check the vendor advisory for the affected versions of github.com/prometheus/prometheus. Attack surface: innerHTML / labels.__name__ / dangerouslySetInnerHTML.

🔥 Severity

Severity: ?. Risk of unauthorized operations or information disclosure.

🔧 How to fix

Update to 2.7.2.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'github.com/prometheus/prometheus' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'github.com/prometheus/prometheus' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で github.com/prometheus/prometheus を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade github.com/prometheus/prometheus to 2.7.2

    ステージング環境で 2.7.2 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

Go github.com/prometheus/prometheus
[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.311.2-0.20260410083055-07c6232d159b"}]}]
Bitnami prometheus
[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.305.2"},{"introduced":"0.306.0"},{"fixed":"0.311.2"},{"introduced":"1.0.0"},{"fixed":"3.5.2"},{"introduced":"3.6.0"},{"fixed":"3.11.2"}]}]

Fix status by distribution

Fixed packages published by each distribution for this CVE

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details