CVE-2021-29622 Arbitrary redirects under /new endpoint
Attackers can craft URLs to redirect users to arbitrary external sites via the /new endpoint in Prometheus.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-29622?
CVE-2021-29622 is a medium-severity vulnerability in prometheus, published on 19 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Prometheus is an open-source monitoring system and time series database. In 2.23.0, Prometheus changed its default UI to the New ui. To ensure a seamless transition, the URL's prefixed by /new redirect to /. Due to a bug in the code, it is possible for an attacker to craft an URL that can redirect to any other URL, in the /new endpoint. If a user visits a prometheus server with a specially crafted address, they can be redirected to an arbitrary URL. The issue was patched in the 2.26.1 and 2.27.1 releases. In 2.28.0, the /new endpoint will be removed completely. The workaround is to disable access to /new via a reverse proxy in front of Prometheus.
Weakness: CWE-601
Which versions are affected by CVE-2021-29622?
3 open source packages ship an affected version, including github.com/prometheus/prometheus and prometheus. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/prometheus/prometheus Go | From 2.23.0 | 2.26.1 |
github.com/prometheus/prometheus Go | From 2.27.0 | 2.27.1 |
prometheus Bitnami | From 2.23.0 | 2.26.1, 2.27.1 |
Linux distribution packages (2)
golang-github-prometheus-prometheus SUSE:Enterprise Storage 6 | All versions | 2.27.1-3.8.1 |
golang-github-prometheus-prometheus openSUSE:Leap 15.3 | All versions | 2.27.1-3.8.1 |
Products include Prometheus Prometheus.
How do I fix CVE-2021-29622?
Upgrade github.com/prometheus/prometheus to a fixed version for your release line: 2.26.1 or 2.27.1.
Is CVE-2021-29622 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-29622 exists.
Public exploit code: 1 Nuclei template.
Other vulnerabilities in prometheus
- CVE-2026-42151 Prometheus Azure AD remote write OAuth client secret exposed via config API
- CVE-2026-42154 Prometheus: remote read endpoint allows denial of service via crafted snappy payload
- CVE-2019-3826 Cross-site scripting in prometheus
- CVE-2026-40179 Prometheus: Stored XSS via metric names and label values in web UI tooltips and metrics explorer
- CVE-2026-44903 Prometheus: Stored XSS via crafted histogram bucket label values in the heatmap display of the old Prometheus web UI
Sources
Also known as AZL-6804, BIT-prometheus-2021-29622, CLEANSTART-2026-JD89615, GHSA-vx57-7f4q-fpc7, SUSE-SU-2021:2664-1, UBUNTU-CVE-2021-29622 and 1 more.