CVE-2022-46146: Github.com/prometheus/exporter toolkit Authentication Bypass Vulnerability
MODERATECVE-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.
CVE-2022-46146 at a Glance
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).
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.
Upgrade github.com/prometheus/exporter-toolkit to 0.7.2
Upgrade github.com/prometheus/exporter-toolkit to 0.8.2
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
CVE-2022-46146 Affected Github.com/prometheus/exporter toolkit Versions
2 component(s)| 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
Frequently Asked Questions
What is CVE-2022-46146?
Which Github.com/prometheus/exporter toolkit versions are affected?
What version fixes CVE-2022-46146?
Is github.com/prometheus/exporter-toolkit affected?
What is the CVSS score of CVE-2022-46146?
What CWE is associated with CVE-2022-46146?
How can I check Go dependencies for CVE-2022-46146?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}