Skip to content

fix(deps): update module github.com/prometheus/prometheus to v0.311.2 [security]#1085

Open
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/go-github.com-prometheus-prometheus-vulnerability
Open

fix(deps): update module github.com/prometheus/prometheus to v0.311.2 [security]#1085
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/go-github.com-prometheus-prometheus-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Apr 17, 2026

This PR contains the following updates:

Package Change Age Confidence
github.com/prometheus/prometheus v0.55.1v0.311.2 age confidence

GitHub Vulnerability Alerts

CVE-2026-40179

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.

Severity
  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: 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

Release Notes

prometheus/prometheus (github.com/prometheus/prometheus)

v0.311.2

Compare Source

v0.311.1

Compare Source

v0.311.0

Compare Source

v0.310.0

Compare Source

v0.309.1

Compare Source

v0.309.0

Compare Source

v0.308.1

Compare Source

v0.308.0

Compare Source

v0.307.3

Compare Source

v0.307.2

Compare Source

v0.307.1

Compare Source

v0.307.0

Compare Source

v0.306.0

Compare Source

v0.305.2

Compare Source

v0.305.1

Compare Source

v0.305.0

Compare Source

v0.304.2

Compare Source

v0.304.1

Compare Source

v0.304.0

Compare Source

v0.303.1

Compare Source

v0.303.0

Compare Source

v0.302.1

Compare Source

v0.302.0

Compare Source

v0.301.0

Compare Source

v0.300.1

Compare Source

v0.300.0

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
Copy link
Copy Markdown
Contributor Author

renovate bot commented Apr 17, 2026

ℹ️ Artifact update notice

File name: go.mod

In order to perform the update(s) described in the table above, Renovate ran the go get command, which resulted in the following additional change(s):

  • 31 additional dependencies were updated

Details:

Package Change
github.com/fsnotify/fsnotify v1.7.0 -> v1.9.0
github.com/google/go-querystring v1.1.0 -> v1.2.0
github.com/hashicorp/go-version v1.7.0 -> v1.8.0
github.com/prometheus/common v0.59.1 -> v0.67.5
golang.org/x/oauth2 v0.27.0 -> v0.36.0
k8s.io/client-go v0.31.14 -> v0.35.3
github.com/Microsoft/go-winio v0.6.1 -> v0.6.2
github.com/edsrzf/mmap-go v1.1.0 -> v1.2.0
github.com/fxamacker/cbor/v2 v2.7.0 -> v2.9.0
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc -> v0.0.0-20250905093917-f7b3be9d1853
github.com/modern-go/reflect2 v1.0.2 -> v1.0.3-0.20250322232337-35a7c28c31ee
github.com/prometheus/client_golang v1.20.3 -> v1.23.2
github.com/prometheus/client_model v0.6.1 -> v0.6.2
github.com/prometheus/procfs v0.15.1 -> v0.16.1
github.com/spf13/pflag v1.0.5 -> v1.0.10
go.opentelemetry.io/otel v1.29.0 -> v1.42.0
go.opentelemetry.io/otel/metric v1.29.0 -> v1.42.0
go.opentelemetry.io/otel/trace v1.29.0 -> v1.42.0
golang.org/x/arch v0.8.0 -> v0.8.0
golang.org/x/crypto v0.45.0 -> v0.49.0
golang.org/x/net v0.47.0 -> v0.52.0
golang.org/x/sys v0.38.0 -> v0.42.0
golang.org/x/term v0.37.0 -> v0.41.0
golang.org/x/text v0.31.0 -> v0.35.0
golang.org/x/time v0.6.0 -> v0.15.0
google.golang.org/protobuf v1.34.2 -> v1.36.11
k8s.io/apimachinery v0.31.14 -> v0.35.3
k8s.io/klog/v2 v2.130.1 -> v2.140.0
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 -> v0.0.0-20251002143259-bc988d571ff4
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd -> v0.0.0-20250730193827-2d320260d730
sigs.k8s.io/yaml v1.4.0 -> v1.6.0

@ti-chi-bot ti-chi-bot bot requested a review from liubog2008 April 17, 2026 22:53
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 17, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign liubog2008 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the size/XL label Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants