Skip to content

UI: Fix stored XSS via unescaped metric names and labels#18507

Merged
roidelapluie merged 1 commit into
prometheus:release-3.5from
roidelapluie:roidelapluie/backport-xss-issue-3.5
Apr 10, 2026
Merged

UI: Fix stored XSS via unescaped metric names and labels#18507
roidelapluie merged 1 commit into
prometheus:release-3.5from
roidelapluie:roidelapluie/backport-xss-issue-3.5

Conversation

@roidelapluie
Copy link
Copy Markdown
Member

@roidelapluie roidelapluie commented Apr 10, 2026

Metric names, label names, and label values containing HTML/JavaScript were inserted into innerHTML without escaping in several UI code paths, enabling stored XSS attacks via crafted metrics. This mostly becomes exploitable in Prometheus 3.x, since it defaults to allowing any UTF-8 characters in metric and label names.

Apply escapeHTML() to all user-controlled values before innerHTML insertion in:

  • Mantine UI chart tooltip
  • Old React UI chart tooltip
  • Old React UI metrics explorer fuzzy search
  • Old React UI heatmap tooltip

See GHSA-vffh-x6r8-xx99

Which issue(s) does the PR fix:

Release notes for end users (ALL commits must be considered).

Reviewers should verify clarity and quality.

[SECURITY] UI: Fix stored XSS via unescaped metric names and labels in chart tooltips and metrics explorer. GHSA-vffh-x6r8-xx99

@roidelapluie roidelapluie requested a review from juliusv as a code owner April 10, 2026 09:28
Metric names, label names, and label values containing HTML/JavaScript were
inserted into `innerHTML` without escaping in several UI code paths, enabling
stored XSS attacks via crafted metrics. This mostly becomes exploitable in
Prometheus 3.x, since it defaults to allowing any UTF-8 characters in metric
and label names.

Apply `escapeHTML()` to all user-controlled values before innerHTML
insertion in:

* Mantine UI chart tooltip
* Old React UI chart tooltip
* Old React UI metrics explorer fuzzy search
* Old React UI heatmap tooltip

See GHSA-vffh-x6r8-xx99

Signed-off-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
@roidelapluie roidelapluie force-pushed the roidelapluie/backport-xss-issue-3.5 branch from c939c6d to a7b8669 Compare April 10, 2026 09:57
Copy link
Copy Markdown
Member

@juliusv juliusv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@roidelapluie roidelapluie merged commit 56a4f03 into prometheus:release-3.5 Apr 10, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants