CVE-2024-35183: Github.com/wolfi dev/wolfictl Wolfictl Leaks GitHub Tokens To Vulnerability
MODERATECVE-2024-35183 is a MODERATE (CVSS 4.4) wolfictl leaks github tokens to vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Github.com/wolfi dev/wolfictl libraries in the Go ecosystem. The issue involves wolfictl leaks github tokens to remote non-github git servers. Remediation is available by upgrading affected packages to version 0.16.10.
CVE-2024-35183 at a Glance
Security Impact
CVSS: 4.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:N).
How to Fix CVE-2024-35183
To remediate this vulnerability, upgrade all affected Github.com/wolfi dev/wolfictl 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/wolfi-dev/wolfictl to 0.16.10
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/wolfi-dev/wolfictl
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-35183, inspect your project dependencies for Github.com/wolfi dev/wolfictl:
inspect dependencies for github.com/wolfi-dev/wolfictl
Analyze the terminal output to locate any version of Github.com/wolfi dev/wolfictl in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.16.10), 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-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Github.com/wolfi dev/wolfictl, 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-2024-35183 Affected Github.com/wolfi dev/wolfictl Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/wolfi-dev/wolfictl
|
Go |
< 0.16.10
|
0.16.10
|
References
Frequently Asked Questions
What is CVE-2024-35183?
Which Github.com/wolfi dev/wolfictl versions are affected?
What version fixes CVE-2024-35183?
Is github.com/wolfi-dev/wolfictl affected?
What is the CVSS score of CVE-2024-35183?
What CWE is associated with CVE-2024-35183?
How can I check Go dependencies for CVE-2024-35183?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8fg7-hp93-qhvr",
"modified" : "2024-05-16T14:11:10Z",
"published" : "2024-05-15T20:02:14Z",
"aliases" : [ "CVE-2024-35183" ],
"summary" : "wolfictl leaks GitHub tokens to remote non-GitHub git servers",
"details" : "### Summary\n\nA git authentication issue allows a local user’s GitHub token to be sent to remote servers other than `github.com`.\n\n### Details\n\nMost git-dependent functionality in wolfictl relies on its own `git` package, which contains centralized logic for implementing interactions with git repositories. Some of this functionality requires authentication in order to access private repositories. There’s a central function `GetGitAuth`:\n\nhttps://github.com/wolfi-dev/wolfictl/blob/6d99909f7b1aa23f732d84dad054b02a61f530e6/pkg/git/git.go#L22\n\nThis looks for a GitHub token in the environment variable `GITHUB_TOKEN` and returns it as an HTTP basic auth object to be used with the `github.com/go-git/go-git/v5` library.\n\nMost callers (direct or indirect) of `GetGitAuth` use the token to authenticate to github.com only; however, in some cases callers were passing this authentication without checking that the remote git repository was hosted on github.com.\n\n#### Issue 1\n\nOne of these callers processed git URLs from Melange package configurations, cloning the package’s upstream repository in order to determine which project dependencies have been upgraded since the prior update.\n\nhttps://github.com/wolfi-dev/wolfictl/blob/4dd6c95abb4bc0f9306350a8601057bd7a92bded/pkg/update/deps/cleanup.go#L49\n\nThis issue affects the command `wolfictl check update`, and the set of remote git hosts is a function of the Melange package configuration files residing in the local directory specified in the command.\n\n#### Issue 2\n\nAnother caller processes a git URL received as a command line argument and clones the repository to look for new available versions of the given project.\n\nhttps://github.com/wolfi-dev/wolfictl/blob/488b53823350caa706de3f01ec0eded9350c7da7/pkg/update/update.go#L143\n\nThis issue affects the command `wolfictl update`.\n\n---\n\nThis behavior has existed in one form or another since https://github.com/wolfi-dev/wolfictl/commit/0d06e1578300327c212dda26a5ab31d09352b9d0 - committed January 25, 2023.\n\n### PoC\n\n```shell\nGITHUB_TOKEN=test wolfictl update http://git.example.com/\n```\n\nExamining traffic sent to the remote server will show that the HTTP `Authorization` header contains `test` in base64 encoded format.\n\n### Impact\n\nThis impacts anyone who ran the `wolfictl check update` commands with a Melange configuration that included a `git-checkout` directive step that referenced a git repository not hosted on github.com. \n\nThis also impacts anyone who ran `wolfictl update <url>` with a remote URL outside of github.com. \n\nAdditionally, these subcommands must have run with the `GITHUB_TOKEN` environment variable set to a valid GitHub token.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/wolfi-dev/wolfictl"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.16.10"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/wolfi-dev/wolfictl/security/advisories/GHSA-8fg7-hp93-qhvr"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-35183"
}, {
"type" : "WEB",
"url" : "https://github.com/wolfi-dev/wolfictl/commit/0d06e1578300327c212dda26a5ab31d09352b9d0"
}, {
"type" : "WEB",
"url" : "https://github.com/wolfi-dev/wolfictl/commit/403e93569f46766b4e26e06cf9cd0cae5ee0c2a2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/wolfi-dev/wolfictl"
}, {
"type" : "WEB",
"url" : "https://github.com/wolfi-dev/wolfictl/blob/488b53823350caa706de3f01ec0eded9350c7da7/pkg/update/update.go#L143"
}, {
"type" : "WEB",
"url" : "https://github.com/wolfi-dev/wolfictl/blob/4dd6c95abb4bc0f9306350a8601057bd7a92bded/pkg/update/deps/cleanup.go#L49"
}, {
"type" : "WEB",
"url" : "https://github.com/wolfi-dev/wolfictl/blob/6d99909f7b1aa23f732d84dad054b02a61f530e6/pkg/git/git.go#L22"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-552", "CWE-668" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-15T20:02:14Z",
"nvd_published_at" : "2024-05-15T22:15:08Z"
}
}