GHSA-4v48-4q5m-8vx4: Github.com/prometheus/prometheus Authentication Bypass Vulnerability

HIGH
CVSS 7.2
CWE-303
Published
Advisory Summary

GHSA-4v48-4q5m-8vx4 is a HIGH (CVSS 7.2) authentication bypass vulnerability (CWE-303: Incorrect Implementation of Authentication Algorithm) affecting Github.com/prometheus/prometheus libraries in the Go ecosystem. The issue involves prometheus vulnerable to basic authentication bypass. Remediation is available by upgrading affected packages to version 2.37.4, 2.40.4.

GHSA-4v48-4q5m-8vx4 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-4v48-4q5m-8vx4
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-303: Incorrect Implementation of Authentication Algorithm
Affected Product Github.com/prometheus/prometheus
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-4v48-4q5m-8vx4

To remediate this vulnerability, upgrade all affected Github.com/prometheus/prometheus dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/prometheus/prometheus fixed: 2.37.4
Upgrade github.com/prometheus/prometheus to 2.37.4
github.com/prometheus/prometheus fixed: 2.40.4
Upgrade github.com/prometheus/prometheus to 2.40.4
github.com/prometheus/prometheus/v2 fixed: 2.37.4
Upgrade github.com/prometheus/prometheus/v2 to 2.37.4
github.com/prometheus/prometheus/v2 fixed: 2.40.4
Upgrade github.com/prometheus/prometheus/v2 to 2.40.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/prometheus/prometheus

How to Check if You Are Affected

To determine whether your application is affected by GHSA-4v48-4q5m-8vx4, inspect your project dependencies for Github.com/prometheus/prometheus:

inspect dependencies for github.com/prometheus/prometheus

Analyze the terminal output to locate any version of Github.com/prometheus/prometheus in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.37.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-303: Incorrect Implementation of Authentication Algorithm, where the requirements for the product dictate the use of an established authentication algorithm, but the implementation of the algorithm is incorrect. In Github.com/prometheus/prometheus, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://github.com/prometheus/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](https://prometheus.io/docs/introduction/release-cycle/)) 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.

GHSA-4v48-4q5m-8vx4 Affected Github.com/prometheus/prometheus Versions

4 component(s)
Fixed Versions:
2.37.42.40.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/prometheus/prometheus
Go
≥ 2.24.1
< 2.37.4
2.37.4
github.com/prometheus/prometheus
Go
≥ 2.38.0
< 2.40.4
2.40.4
github.com/prometheus/prometheus/v2
Go
≥ 2.24.1
< 2.37.4
2.37.4
github.com/prometheus/prometheus/v2
Go
≥ 2.38.0
< 2.40.4
2.40.4

References

Frequently Asked Questions

What is GHSA-4v48-4q5m-8vx4?
GHSA-4v48-4q5m-8vx4 is a security vulnerability in Github.com/prometheus/prometheus involving Prometheus vulnerable to basic authentication bypass under CWE-303: Incorrect Implementation of Authentication Algorithm.
Which Github.com/prometheus/prometheus versions are affected?
Affected versions include releases prior to 2.37.4, 2.40.4 across affected packages: github.com/prometheus/prometheus, github.com/prometheus/prometheus/v2.
What version fixes GHSA-4v48-4q5m-8vx4?
Upgrading to 2.37.4, 2.40.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/prometheus/prometheus affected?
Yes, github.com/prometheus/prometheus is affected in releases prior to 2.37.4, 2.40.4. Upgrade your dependency to 2.37.4, 2.40.4 or later.
Is github.com/prometheus/prometheus/v2 affected?
Yes, github.com/prometheus/prometheus/v2 is affected in releases prior to 2.37.4, 2.40.4. Upgrade your dependency to 2.37.4, 2.40.4 or later.
What is the CVSS score of GHSA-4v48-4q5m-8vx4?
GHSA-4v48-4q5m-8vx4 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with GHSA-4v48-4q5m-8vx4?
GHSA-4v48-4q5m-8vx4 is classified under CWE-303: Incorrect Implementation of Authentication Algorithm (The requirements for the product dictate the use of an established authentication algorithm, but the implementation of the algorithm is incorrect.).
How can I check Go dependencies for GHSA-4v48-4q5m-8vx4?
Run the dependency tree command: 'inspect dependencies for github.com/prometheus/prometheus'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4v48-4q5m-8vx4",
  "modified" : "2026-04-15T20:59:32Z",
  "published" : "2022-12-05T22:01:08Z",
  "aliases" : [ ],
  "summary" : "Prometheus vulnerable to basic authentication bypass",
  "details" : "### Impact\n\nPrometheus can be secured by a web.yml file that specifies usernames and hashed passwords for basic authentication.\n\nPasswords 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.\n\nHowever, a flaw in the way this mechanism was implemented in the [exporter toolkit](https://github.com/prometheus/exporter-toolkit) makes it possible with people who know the hashed password to authenticate against Prometheus.\n\nA 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.\n\n### Patches\n\nPrometheus 2.37.4 ([LTS](https://prometheus.io/docs/introduction/release-cycle/)) and 2.40.4 have been released to address this issue.\n\n### Workarounds\n\nThere is no workaround but attacker must have access to the hashed password, stored in disk, to bypass the authentication.\n\n### Credit\n\nWe want to thank Lei Wan for reporting this security issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/prometheus/prometheus"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.24.1"
      }, {
        "fixed" : "2.37.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/prometheus/prometheus"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.38.0"
      }, {
        "fixed" : "2.40.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/prometheus/prometheus/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.24.1"
      }, {
        "fixed" : "2.37.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/prometheus/prometheus/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.38.0"
      }, {
        "fixed" : "2.40.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/prometheus/prometheus/security/advisories/GHSA-4v48-4q5m-8vx4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/prometheus/prometheus/commit/31a2db3ae9c0f4b486b6895973beabc1d1beac93"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/prometheus/prometheus/releases/tag/v2.37.4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/prometheus/prometheus/releases/tag/v2.40.4"
  }, {
    "type" : "PACKAGE",
    "url" : "github.com/prometheus/prometheus"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-303" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-12-05T22:01:08Z",
    "nvd_published_at" : null
  }
}