CVE-2026-40179
ADVISORY - githubSummary
Impact
Stored cross-site scripting (XSS) via crafted metric names in the Prometheus web UI:
- Old React UI + New Mantine UI: When a user hovers over a chart tooltip on the Graph page, metric names containing HTML/JavaScript are injected into
innerHTMLwithout escaping, causing arbitrary script execution in the user's browser. - Old React UI only: When a user opens the Metric Explorer (globe icon next to the PromQL expression input field), and a metric name containing HTML/JavaScript is rendered in the fuzzy search results, it is injected into
innerHTMLwithout escaping, causing arbitrary script execution in the user's browser. - Old React UI only: When a user views a heatmap chart and hovers over a cell, the
lelabel values of the underlying histogram buckets are interpolated intoinnerHTMLwithout escaping. Whileleis conventionally a numeric bucket boundary, Prometheus does not enforce this — arbitrary UTF-8 strings are accepted as label values, allowing script injection via a crafted scrape target or remote write.
With Prometheus v3.x defaulting to UTF-8 metric and label name validation, characters like <, >, and " are now valid in metric names and labels, making this exploitable.
An attacker who can inject metrics (via a compromised scrape target, remote write, or OTLP receiver endpoint) can execute JavaScript in the browser of any Prometheus user who views the metric in the Graph UI. From the XSS context, an attacker could for example:
- Read
/api/v1/status/configto extract sensitive configuration (although credentials / secrets are redacted by the server) - Call
/-/quitto shut down Prometheus (only if--web.enable-lifecycleis set) - Call
/api/v1/admin/tsdb/delete_seriesto delete data (only if--web.enable-admin-apiis set) - Exfiltrate metric data to an external server
Both the new Mantine UI and the old React UI are affected. The vulnerable code paths are:
web/ui/mantine-ui/src/pages/query/uPlotChartHelpers.ts— tooltipinnerHTMLwith unescapedlabels.__name__web/ui/react-app/src/pages/graph/GraphHelpers.ts— tooltip content with unescapedlabels.__name__web/ui/react-app/src/pages/graph/MetricsExplorer.tsx— fuzzy search results rendered viadangerouslySetInnerHTMLwithout sanitizationweb/ui/react-app/src/vendor/flot/jquery.flot.heatmap.js— heatmap tooltip with unescaped label values
Patches
A patch has been published in Prometheus 3.5.2 LTS and Prometheus 3.11.2. The fix applies escapeHTML() to all user-controlled values (metric names and label values) before inserting them into innerHTML. This advisory will be updated with the patched version once released.
Workarounds
- If using the remote write receiver (
--web.enable-remote-write-receiver), ensure it is not exposed to untrusted sources. - If using the OTLP receiver (
--web.enable-otlp-receiver), ensure it is not exposed to untrusted sources. - Ensure scrape targets are trusted and not under attacker control.
- Do not enable admin / mutating API endpoints (e.g.
--web.enable-admin-apiorweb.enable-lifecycle) in cases where you cannot prevent untrusted data from being ingested. - Users should avoid clicking untrusted links, especially those containing functions such as label_replace, as they may generate poisoned label names and values.
Acknowledgements
Thanks to @gladiator9797 (Duc Anh Nguyen from TinyxLab) for reporting this.
Common Weakness Enumeration (CWE)
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
GitHub
2.8
CVSS SCORE
5.3medium| Package | Type | OS Name | OS Version | Affected Ranges | Fix Versions |
|---|---|---|---|---|---|
| github.com/prometheus/prometheus | golang | - | - | <0.311.2-0.20260410083055-07c6232d159b | 0.311.2-0.20260410083055-07c6232d159b |
| github.com/prometheus/prometheus | golang | - | - | >=3.0.0,<=3.5.1 | Not yet available |
| github.com/prometheus/prometheus | golang | - | - | >=3.6.0,<=3.11.1 | Not yet available |
| github.com/prometheus/prometheus | golang | - | - | >=0.0.0-20241114161949-c5d009d57fcc,<=0.0.0-20260121132759-7d42ddfaad88 | 0.0.0-20260121132759-7d42ddfaad88 |
CVSS:4 Severity and metrics
The CVSS metrics represent different qualitative aspects of a vulnerability that impact the overall score, as defined by the CVSS Specification.
The vulnerable component is bound to the network stack, but the attack is limited at the protocol level to a logically adjacent topology. This can mean an attack must be launched from the same shared physical (e.g., Bluetooth or IEEE 802.11) or logical (e.g., local IP subnet) network, or from within a secure or otherwise limited administrative domain (e.g., MPLS, secure VPN to an administrative network zone). One example of an Adjacent attack would be an ARP (IPv4) or neighbor discovery (IPv6) flood leading to a denial of service on the local LAN segment (e.g., CVE-2013-6014).
Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.
The successful attack does not depend on the deployment and execution conditions of the vulnerable system. The attacker can expect to be able to reach the vulnerability and execute the exploit under all or most instances of the vulnerability.
The attacker is unauthenticated prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.
Successful exploitation of this vulnerability requires limited interaction by the targeted user with the vulnerable system and the attacker's payload. These interactions would be considered involuntary and do not require that the user actively subvert protections built into the vulnerable system. Examples include: utilizing a website that has been modified to display malicious content when the page is rendered (most stored XSS or CSRF) running an application that calls a malicious binary that has been planted on the system using an application which generates traffic over an untrusted or compromised network (vulnerabilities requiring an on-path attacker).
There is no loss of confidentiality within the Vulnerable System.
There is some loss of confidentiality. Access to some restricted information is obtained, but the attacker does not have control over what information is obtained, or the amount or kind of loss is limited. The information disclosure does not cause a direct, serious loss to the Subsequent System.
There is no loss of integrity within the Vulnerable System.
Modification of data is possible, but the attacker does not have control over the consequence of a modification, or the amount of modification is limited. The data modification does not have a direct, serious impact to the Subsequent System.
There is no impact to availability within the Vulnerable System.
There is no impact to availability within the Subsequent System or all availability impact is constrained to the Vulnerable System.
Docker
CVE-2026-40179
-
NIST
2.8
CVSS SCORE
5.3mediumAlpine
-
Debian
-
CVSS SCORE
N/AlowUbuntu
2.8
CVSS SCORE
6.1mediumGoLang
-
Bitnami
BIT-prometheus-2026-40179
-
CVSS SCORE
5.3mediumChainguard
CGA-j4ph-g7ff-g67c
-
minimos
MINI-26m5-2c9v-4hhg
-
minimos
MINI-28gg-m7jc-jvqf
-
minimos
MINI-2gg2-j3v9-w82c
-
minimos
MINI-2qpg-f588-6hj7
-
minimos
MINI-2rw8-p347-p4m2
-
minimos
MINI-3268-279r-5f6q
-
minimos
MINI-336q-gwfc-4j8f
-
minimos
MINI-395r-xx6p-37g9
-
minimos
MINI-3fpg-f5m4-xjpw
-
minimos
MINI-3m3w-7wq6-7pr7
-
minimos
MINI-3vq8-mj59-mf68
-
minimos
MINI-3xwj-pwpp-7gw8
-
minimos
MINI-43r2-m8hw-xpxf
-
minimos
MINI-494q-5q32-8xpj
-
minimos
MINI-4mxh-fm5f-p36f
-
minimos
MINI-53v4-89wx-5mfp
-
minimos
MINI-5g8w-7wcm-c9xr
-
minimos
MINI-5rg6-f788-768q
-
minimos
MINI-5xcm-9gvc-3mw9
-
minimos
MINI-5xg6-h44h-48q3
-
minimos
MINI-644x-j325-pj5j
-
minimos
MINI-6hvh-r373-4f69
-
minimos
MINI-6qvc-p89q-75wr
-
minimos
MINI-723r-75m9-8jw5
-
minimos
MINI-75cc-cxgx-8xh4
-
minimos
MINI-7r72-4qjr-ggfr
-
minimos
MINI-7r9w-624p-795c
-
minimos
MINI-7v5p-fv2w-x5jc
-
minimos
MINI-7vgh-pj53-8q9g
-
minimos
MINI-7xvc-vx3j-hvx6
-
minimos
MINI-82hv-q3qg-vm9r
-
minimos
MINI-8467-rmw5-6p3w
-
minimos
MINI-87m4-mq7c-57pf
-
minimos
MINI-8j8r-x772-vc6q
-
minimos
MINI-8vcm-vgjg-c2m9
-
minimos
MINI-93qf-f7cv-h48j
-
minimos
MINI-9622-rc8h-jqrh
-
minimos
MINI-96m6-53wj-473c
-
minimos
MINI-975v-g53p-r33r
-
minimos
MINI-97pw-c52p-r428
-
minimos
MINI-9hh8-c5v9-cc49
-
minimos
MINI-9jfx-42xw-gqj6
-
minimos
MINI-9jjw-fvmm-27pc
-
minimos
MINI-9px8-w897-jv23
-
minimos
MINI-9pxx-f3w8-5qp5
-
minimos
MINI-c4f8-p29p-qwcr
-
minimos
MINI-c5hg-wj89-prp8
-
minimos
MINI-cfc9-64f9-vmjr
-
minimos
MINI-ch29-8rr8-9g4j
-
minimos
MINI-cm8r-hrj4-gpf6
-
minimos
MINI-cmm7-w2rh-7gqh
-
minimos
MINI-cmmw-4r52-25v7
-
minimos
MINI-cw72-68q2-pfh8
-
minimos
MINI-f7rx-m55m-j6c8
-
minimos
MINI-f8r8-m946-23p8
-
minimos
MINI-f9f4-w4g7-346v
-
minimos
MINI-fjqq-rwwh-g835
-
minimos
MINI-fqmf-f2vp-pm27
-
minimos
MINI-fr26-v265-8hj5
-
minimos
MINI-fvf3-m47v-6g83
-
minimos
MINI-fw64-52r6-7v58
-
minimos
MINI-g5vr-fxqw-3494
-
minimos
MINI-g8pw-72m7-r37q
-
minimos
MINI-gc3m-m32h-mc83
-
minimos
MINI-gp34-c9mp-678r
-
minimos
MINI-gq79-qfv6-3g2v
-
minimos
MINI-h3cw-fg56-gcm3
-
minimos
MINI-h476-mcj5-7xx6
-
minimos
MINI-hhjv-3qw2-4x54
-
minimos
MINI-hq72-cfvq-36g9
-
minimos
MINI-hq7h-2rc8-gxwf
-
minimos
MINI-hvm8-xhp8-5h82
-
minimos
MINI-hwh9-rpcj-j6vw
-
minimos
MINI-jcrf-7w2f-xw2r
-
minimos
MINI-jp23-fhc8-rhq5
-
minimos
MINI-jvc4-wxqc-m4c5
-
minimos
MINI-jvm9-9w76-4cw5
-
minimos
MINI-jw64-wf2q-h5qq
-
minimos
MINI-m246-x42p-4qh6
-
minimos
MINI-m2f4-ghj8-9hfm
-
minimos
MINI-m3r5-2gfj-jrp6
-
minimos
MINI-mf5f-cwgw-rgvw
-
minimos
MINI-mg35-8fpj-g3pf
-
minimos
MINI-mgpm-86p6-mw3f
-
minimos
MINI-mq6v-r49m-658x
-
minimos
MINI-mv3j-8gv6-2xj4
-
minimos
MINI-mv9x-gvgh-q887
-
minimos
MINI-p339-m57h-hr4g
-
minimos
MINI-p5xj-2473-w7jq
-
minimos
MINI-pcmh-h7g2-xfmm
-
minimos
MINI-phgw-4734-9fgh
-
minimos
MINI-pjxg-w799-x9w6
-
minimos
MINI-pmm2-28r6-w7jr
-
minimos
MINI-q676-wj52-8v8r
-
minimos
MINI-q7jr-jfpj-x2ch
-
minimos
MINI-qg7g-c34r-7vc6
-
minimos
MINI-qhp9-223m-82hm
-
minimos
MINI-qwh7-fpxh-63g2
-
minimos
MINI-r2rv-8w94-jj96
-
minimos
MINI-r4hr-55hg-25qg
-
minimos
MINI-r773-2xf3-xjj5
-
minimos
MINI-r7ww-g2vw-xg2c
-
minimos
MINI-r8jm-p4m2-8m96
-
minimos
MINI-rc3p-98c8-g5c5
-
minimos
MINI-rhq7-37v2-cjmw
-
minimos
MINI-rp66-xwq3-76gc
-
minimos
MINI-rq2p-2wr3-vh74
-
minimos
MINI-v2c4-frxm-g7w9
-
minimos
MINI-v5xh-5cj2-c674
-
minimos
MINI-vhq9-f488-9h6x
-
minimos
MINI-vj7p-v9qj-27qf
-
minimos
MINI-vrg4-28f4-5c9c
-
minimos
MINI-w7hg-5cg7-jhgh
-
minimos
MINI-wj92-xwhh-wj33
-
minimos
MINI-wq37-pqcj-cr36
-
minimos
MINI-wrx4-95gj-63jg
-
minimos
MINI-wx37-rr4c-qpm3
-
minimos
MINI-x4jm-j55m-wp3h
-
minimos
MINI-xphc-gvrh-jj76
-
minimos
MINI-xr5m-3833-xvxq
-