CVE-2021-29622 Arbitrary redirects under /new endpoint

Medium 6.5 Published Updated

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.

PackageAffectedFixed in
github.com/prometheus/prometheus GoFrom 2.23.02.26.1
github.com/prometheus/prometheus GoFrom 2.27.02.27.1
prometheus BitnamiFrom 2.23.02.26.1, 2.27.1
Linux distribution packages (2)
golang-github-prometheus-prometheus SUSE:Enterprise Storage 6All versions2.27.1-3.8.1
golang-github-prometheus-prometheus openSUSE:Leap 15.3All versions2.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.

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.

Is CVE-2021-29622 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free