Vulnerabilities in pkg:golang/github.com/prometheus/exporter-toolkit

PACKAGE
Advisory Identifier: GHSA-7rg2-cxvp-9p7p
Advisory Summary

CVE-2022-46146 is a MODERATE (CVSS 6.2) authentication bypass vulnerability (CWE-287: Improper Authentication) affecting Github.com/prometheus/exporter toolkit libraries in the Go ecosystem. The issue involves prometheus exporter-toolkit is vulnerable to authentication bypass. Remediation is available by upgrading affected packages to version 0.7.2, 0.8.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/prometheus/exporter-toolkit

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/prometheus/exporter-toolkit. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7rg2-cxvp-9p7p CVE-2022-46146 MODERATE Prometheus Exporter-Toolkit is vulnerable to authentication bypass

CVE-2022-46146 at a Glance

CVE Identifier CVE-2022-46146
GHSA Identifier GHSA-7rg2-cxvp-9p7p
Severity MODERATE
CVSS v3.1 Base Score 6.2
CWE Classification CWE-287: Improper Authentication
Affected Product Github.com/prometheus/exporter toolkit
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.2

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

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

How to Fix CVE-2022-46146

To remediate this vulnerability, upgrade all affected Github.com/prometheus/exporter toolkit 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/exporter-toolkit fixed: 0.7.2
Upgrade github.com/prometheus/exporter-toolkit to 0.7.2
github.com/prometheus/exporter-toolkit fixed: 0.8.2
Upgrade github.com/prometheus/exporter-toolkit to 0.8.2
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/exporter-toolkit

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-46146, inspect your project dependencies for Github.com/prometheus/exporter toolkit:

inspect dependencies for github.com/prometheus/exporter-toolkit

Analyze the terminal output to locate any version of Github.com/prometheus/exporter toolkit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.2), 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Github.com/prometheus/exporter toolkit, 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 and its exporters 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 The exporter-toolkit v0.7.3 and v0.8.2 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 reporting this security issue.

CVE-2022-46146 Affected Github.com/prometheus/exporter toolkit Versions

2 component(s)
Fixed Versions:
0.7.20.8.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/prometheus/exporter-toolkit
Go
< 0.7.2
0.7.2
github.com/prometheus/exporter-toolkit
Go
≥ 0.8.0
< 0.8.2
0.8.2

References

GitHub Advisory / Wiki ADVISORY
https://github.com/prometheus/exporter-toolkit/security/advisories/GHSA-7rg2-cxvp-9p7p
NVD — CVE-2022-46146 NVD
https://nvd.nist.gov/vuln/detail/CVE-2022-46146
Security Fix Commit FIX COMMIT
https://github.com/prometheus/exporter-toolkit/commit/25288779bc59d00c41b4a1706c6b87f0561ef2d7
Security Fix Commit FIX COMMIT
https://github.com/prometheus/exporter-toolkit/commit/5b1eab34484ddd353986bce736cd119d863e4ff5
Github.com/prometheus/exporter toolkit Source Repository REPOSITORY
https://github.com/prometheus/exporter-toolkit
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JRSHISR64L6QGSMDFZDNPHHIXSCAKK26
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UH24VXIB25OGHF4VGY4PLZMTGTI3BHCA
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ULVDTAI76VATRAHTKCE2SUJ4NC3PQZ6Y
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JRSHISR64L6QGSMDFZDNPHHIXSCAKK26
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UH24VXIB25OGHF4VGY4PLZMTGTI3BHCA
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ULVDTAI76VATRAHTKCE2SUJ4NC3PQZ6Y
Github.com/prometheus/exporter toolkit Security Information SECURITY
https://security.gentoo.org/glsa/202401-15
Github.com/prometheus/exporter toolkit Security Information SECURITY
http://www.openwall.com/lists/oss-security/2022/11/29/1
Github.com/prometheus/exporter toolkit Security Information SECURITY
http://www.openwall.com/lists/oss-security/2022/11/29/2
Github.com/prometheus/exporter toolkit Security Information SECURITY
http://www.openwall.com/lists/oss-security/2022/11/29/4

Frequently Asked Questions

What is CVE-2022-46146?
CVE-2022-46146 is a security vulnerability in Github.com/prometheus/exporter toolkit involving Prometheus Exporter-Toolkit is vulnerable to authentication bypass under CWE-287: Improper Authentication.
Which Github.com/prometheus/exporter toolkit versions are affected?
Affected versions include releases prior to 0.7.2, 0.8.2 across affected packages: github.com/prometheus/exporter-toolkit.
What version fixes CVE-2022-46146?
Upgrading to 0.7.2, 0.8.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/prometheus/exporter-toolkit affected?
Yes, github.com/prometheus/exporter-toolkit is affected in releases prior to 0.7.2, 0.8.2. Upgrade your dependency to 0.7.2, 0.8.2 or later.
What is the CVSS score of CVE-2022-46146?
CVE-2022-46146 has a CVSS v3.1 base score of 6.2 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2022-46146?
CVE-2022-46146 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Go dependencies for CVE-2022-46146?
Run the dependency tree command: 'inspect dependencies for github.com/prometheus/exporter-toolkit'. 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-7rg2-cxvp-9p7p",
  "modified" : "2022-12-02T22:25:46Z",
  "published" : "2022-12-02T22:25:46Z",
  "aliases" : [ "CVE-2022-46146" ],
  "summary" : "Prometheus Exporter-Toolkit is vulnerable to authentication bypass",
  "details" : "### Impact\n\nPrometheus and its exporters 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 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\nThe exporter-toolkit v0.7.3 and v0.8.2 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 reporting this security issue.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/prometheus/exporter-toolkit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.7.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/prometheus/exporter-toolkit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.8.0"
      }, {
        "fixed" : "0.8.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/prometheus/exporter-toolkit/security/advisories/GHSA-7rg2-cxvp-9p7p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-46146"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/prometheus/exporter-toolkit/commit/25288779bc59d00c41b4a1706c6b87f0561ef2d7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/prometheus/exporter-toolkit/commit/5b1eab34484ddd353986bce736cd119d863e4ff5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/prometheus/exporter-toolkit"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JRSHISR64L6QGSMDFZDNPHHIXSCAKK26"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UH24VXIB25OGHF4VGY4PLZMTGTI3BHCA"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ULVDTAI76VATRAHTKCE2SUJ4NC3PQZ6Y"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JRSHISR64L6QGSMDFZDNPHHIXSCAKK26"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UH24VXIB25OGHF4VGY4PLZMTGTI3BHCA"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ULVDTAI76VATRAHTKCE2SUJ4NC3PQZ6Y"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202401-15"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2022/11/29/1"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2022/11/29/2"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2022/11/29/4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-12-02T22:25:46Z",
    "nvd_published_at" : "2022-11-29T14:15:00Z"
  }
}