Vulnerability · Published Apr 15, 2026 · Assigned by GitHub_M
CVE-2026-40179Prometheus: Stored XSS via metric names and label values in web UI tooltips and metrics explorer
Medium 5.3
In plain English
A medium-severity cross-site scripting in prometheus from prometheus. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 24% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official description
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 enabling admin or mutating API endpoints (e.g., --web.enable-admin-api or --web.enable-lifecycle) in environments where untrusted data may be ingested; and refrain from clicking untrusted links, particularly those containing functions such as label_replace, as they may generate poisoned label names and values.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.23 | prometheus | 3.5.3-r0 | ALPINE-CVE-2026-40179 |
| Alpine:v3.24 | prometheus | 3.5.3-r0 | ALPINE-CVE-2026-40179 |
| Go | github.com/prometheus/prometheus | 3.5.2 | GHSA-vffh-x6r8-xx99 |
| Go | github.com/prometheus/prometheus | 3.11.2 | GHSA-vffh-x6r8-xx99 |
| Go | github.com/prometheus/prometheus | 0.311.2-0.20260410083055-07c6232d159b | GHSA-vffh-x6r8-xx99 |
| Go | github.com/prometheus/prometheus | 0.311.2-0.20260410083055-07c6232d159b | GO-2026-5662 |
| Ubuntu:25.10 | prometheus | no fix listed | UBUNTU-CVE-2026-40179 |
| Ubuntu:26.10 | prometheus | no fix listed | UBUNTU-CVE-2026-40179 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| prometheus | prometheus | >= 3.0.0, < 3.5.2>= 3.6.0, < 3.11.2< 0.311.2-0.20260410083055-07c6232d159b |
Weakness: CWE-79 · Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N