HighGHSA-4v48-4q5m-8vx4

Prometheus vulnerable to basic authentication bypass

Published 5 Dec 2022 · Updated 15 Apr 2026

Is your project on an affected github.com/prometheus/prometheus?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected packages

Affected
>=2.24.1 <2.37.4
Fixed in
2.37.4
Update to the fixed version for your release line, for example:go get github.com/prometheus/prometheus@v2.37.4
Affected
>=2.38.0 <2.40.4
Fixed in
2.40.4
Update to the fixed version for your release line, for example:go get github.com/prometheus/prometheus@v2.40.4
Affected
>=2.24.1 <2.37.4
Fixed in
2.37.4
Update to the fixed version for your release line, for example:go get github.com/prometheus/prometheus/v2@v2.37.4
Affected
>=2.38.0 <2.40.4
Fixed in
2.40.4
Update to the fixed version for your release line, for example:go get github.com/prometheus/prometheus/v2@v2.40.4

Details

Impact

Prometheus can be secured by a web.yml file that specifies usernames and hashed passwords for basic authentication.

Passwords are hashed with bcrypt, which means that even if you have access to the hash, it is very hard to find the original password back.

However, a flaw in the way this mechanism was implemented in the exporter toolkit makes it possible with people who know the hashed password to authenticate against Prometheus.

A request can be forged by an attacker to poison the internal cache used to cache the computation of hashes and make subsequent requests successful. This cache is used in both happy and unhappy scenarios in order to limit side channel attacks that could tell an attacker if a user is present in the file or not.

Patches

Prometheus 2.37.4 (LTS) and 2.40.4 have been released to address this issue.

Workarounds

There is no workaround but attacker must have access to the hashed password, stored in disk, to bypass the authentication.

Credit

We want to thank Lei Wan for reporting this security issue.

Is GHSA-4v48-4q5m-8vx4 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/prometheus/prometheus, and gives you the command that fixes it.

More advisories for github.com/prometheus/prometheus

  • LowCVE-2026-40179Prometheus has Stored XSS via metric names and label values in Prometheus web UI in github.com/prometheus/prometheus · 25 Jun 2026
  • LowCVE-2026-42151Prometheus Azure AD remote write OAuth client secret exposed via config API in github.com/prometheus/prometheus · 25 Jun 2026
  • LowCVE-2026-44903Prometheus vulnerable to stored XSS via crafted histogram bucket label values in the old web UI heatmap display in github.com/prometheus/prometheus · 25 Jun 2026
  • LowCVE-2026-42154Prometheus: Remote read endpoint allows denial of service via crafted snappy payload in github.com/prometheus/prometheus · 25 Jun 2026
  • MediumCVE-2026-44903Prometheus vulnerable to stored XSS via crafted histogram bucket label values in the old web UI heatmap display · 5 May 2026
  • HighCVE-2026-42154Prometheus: Remote read endpoint allows denial of service via crafted snappy payload · 5 May 2026
All 9 advisories for github.com/prometheus/prometheus

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.