CVE-2021-29622

CVE-2021-29622 is a medium-severity open redirect vulnerability in github.com/prometheus/prometheus (go), affecting versions >= 2.23.0, < 2.26.1. It is fixed in 2.26.1, 2.27.1, 0.0.0-20210518124745-db7f0bcec27b.

Summary

Workarounds

The workaround is to disable access to /new via a reverse proxy in front of Prometheus.

Note: Users who use a --web.external-url= flag with a path (e.g. --web.external-url=http://example.com/prometheus) are not affected.

For more information

If you have any questions or comments about this advisory, please use our community channels (https://prometheus.io/community).
Our security policy is available at https://prometheus.io/docs/operating/security/

Impact

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 (e.g.: http://127.0.0.1:9090/new/new<url>), they can be redirected to an arbitrary URL.

e.g. if a user visits http://127.0.0.1:9090/new/newhttp://www.google.com/, they will be redirected to http://google.com.

Untrusted input controls a URL used for redirection, which can forward users to attacker-controlled sites. Typical impact: phishing and credential harvesting via a trusted domain.

CVE-2021-29622 has a CVSS score of 6.1 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.26.1, 2.27.1, 0.0.0-20210518124745-db7f0bcec27b); upgrading removes the vulnerable code path.

Affected versions

github.com/prometheus/prometheus (>= 2.23.0, < 2.26.1) github.com/prometheus/prometheus (= 2.27.0) github.com/prometheus/prometheus (> 0.0.0-20201116123734-de1c1243f4dd, < 0.0.0-20210518124745-db7f0bcec27b)

Security releases

github.com/prometheus/prometheus → 2.26.1 (go) github.com/prometheus/prometheus → 2.27.1 (go) github.com/prometheus/prometheus → 0.0.0-20210518124745-db7f0bcec27b (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

The issue will be patched in 2.26.1 and 2.27.1 releases.
In 2.28.0, the /new endpoint will be removed completely.

Frequently Asked Questions

  1. What is CVE-2021-29622? CVE-2021-29622 is a medium-severity open redirect vulnerability in github.com/prometheus/prometheus (go), affecting versions >= 2.23.0, < 2.26.1. It is fixed in 2.26.1, 2.27.1, 0.0.0-20210518124745-db7f0bcec27b. Untrusted input controls a URL used for redirection, which can forward users to attacker-controlled sites.
  2. How severe is CVE-2021-29622? CVE-2021-29622 has a CVSS score of 6.1 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of github.com/prometheus/prometheus are affected by CVE-2021-29622? github.com/prometheus/prometheus (go) versions >= 2.23.0, < 2.26.1 is affected.
  4. Is there a fix for CVE-2021-29622? Yes. CVE-2021-29622 is fixed in 2.26.1, 2.27.1, 0.0.0-20210518124745-db7f0bcec27b. Upgrade to this version or later.
  5. Is CVE-2021-29622 exploitable, and should I be worried? Whether CVE-2021-29622 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2021-29622 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2021-29622?
    • Upgrade github.com/prometheus/prometheus to 2.26.1 or later
    • Upgrade github.com/prometheus/prometheus to 2.27.1 or later
    • Upgrade github.com/prometheus/prometheus to 0.0.0-20210518124745-db7f0bcec27b or later

Other vulnerabilities in github.com/prometheus/prometheus

CVE-2026-44903CVE-2026-42154CVE-2026-40179CVE-2021-29622

Stop the waste.
Protect your environment with Kodem.