Medium severity · published Apr 15, 2026
CVE-2026-40179
Prometheus: Stored XSS via metric names and label values in web UI tooltips and metrics explorer
6.1
CVSS
0.3%
EPSS
No
On KEV
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.
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Confidentiality
Low
Integrity
Low
Availability
None
Scope
Changed
Exploitation
Is it being used?
Exploit prediction (EPSS)0.3% · higher than 18% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
PR
prometheus · prometheus
>= 3.0.0, < 3.5.2; >= 3.6.0, < 3.11.2; < 0.311.2-0.20260410083055-07c6232d159b · source: vendor, NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2026-40179
CVE.org
https://www.cve.org/CVERecord?id=CVE-2026-40179
Patch
https://github.com/prometheus/prometheus/commit/07c6232d159bfb474a077788be184d87adcfac3c
Issue Tracking
https://github.com/prometheus/prometheus/pull/18506
Mitigation
https://github.com/prometheus/prometheus/security/advisories/GHSA-vffh-x6r8-xx99
More from prometheus
7.5
CVE-2026-42154
Prometheus: remote read endpoint allows denial of service via crafted snappy payload
7.5
CVE-2026-42151
Prometheus Azure AD remote write OAuth client secret exposed via config API
6.1
CVE-2026-44903
Prometheus: Stored XSS via crafted histogram bucket label values in the heatmap display of the old Prometheus web UI
6.1
CVE-2021-29622
Prometheus is an open-source monitoring system and time series database
6.1
CVE-2019-3826
A stored, DOM based, cross-site scripting (XSS) flaw was found in Prometheus before version 2.7.1
