Vulnerabilities in pkg:golang/github.com/wolfi-dev/wolfictl

PACKAGE
Advisory Identifier: GHSA-8fg7-hp93-qhvr
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/wolfi-dev/wolfictl

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/wolfi-dev/wolfictl. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-8fg7-hp93-qhvr CVE-2024-35183 MODERATE wolfictl leaks GitHub tokens to remote non-GitHub git servers

CVE-2024-35183 at a Glance

CVE Identifier CVE-2024-35183
GHSA Identifier GHSA-8fg7-hp93-qhvr
Severity MODERATE
CVSS v3.1 Base Score 4.4
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Github.com/wolfi dev/wolfictl
Package Ecosystem Go
Published Date
Last Updated

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).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

github.com/wolfi-dev/wolfictl fixed: 0.16.10
Upgrade github.com/wolfi-dev/wolfictl to 0.16.10
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/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

### Summary A git authentication issue allows a local user’s GitHub token to be sent to remote servers other than `github.com`. ### Details Most 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`: https://github.com/wolfi-dev/wolfictl/blob/6d99909f7b1aa23f732d84dad054b02a61f530e6/pkg/git/git.go#L22 This 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. Most 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. #### Issue 1 One 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. https://github.com/wolfi-dev/wolfictl/blob/4dd6c95abb4bc0f9306350a8601057bd7a92bded/pkg/update/deps/cleanup.go#L49 This 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. #### Issue 2 Another 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. https://github.com/wolfi-dev/wolfictl/blob/488b53823350caa706de3f01ec0eded9350c7da7/pkg/update/update.go#L143 This issue affects the command `wolfictl update`. --- This behavior has existed in one form or another since https://github.com/wolfi-dev/wolfictl/commit/0d06e1578300327c212dda26a5ab31d09352b9d0 - committed January 25, 2023. ### PoC ```shell GITHUB_TOKEN=test wolfictl update http://git.example.com/ ``` Examining traffic sent to the remote server will show that the HTTP `Authorization` header contains `test` in base64 encoded format. ### Impact This 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. This also impacts anyone who ran `wolfictl update <url>` with a remote URL outside of github.com. Additionally, these subcommands must have run with the `GITHUB_TOKEN` environment variable set to a valid GitHub token.

CVE-2024-35183 Affected Github.com/wolfi dev/wolfictl Versions

1 component(s)
Fixed Versions:
0.16.10
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?
CVE-2024-35183 is a security vulnerability in Github.com/wolfi dev/wolfictl involving wolfictl leaks GitHub tokens to remote non-GitHub git servers under CWE-668: Exposure of Resource to Wrong Sphere.
Which Github.com/wolfi dev/wolfictl versions are affected?
Affected versions include releases prior to 0.16.10 across affected packages: github.com/wolfi-dev/wolfictl.
What version fixes CVE-2024-35183?
Upgrading to 0.16.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/wolfi-dev/wolfictl affected?
Yes, github.com/wolfi-dev/wolfictl is affected in releases prior to 0.16.10. Upgrade your dependency to 0.16.10 or later.
What is the CVSS score of CVE-2024-35183?
CVE-2024-35183 has a CVSS v3.1 base score of 4.4 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-35183?
CVE-2024-35183 is classified under CWE-668: Exposure of Resource to Wrong Sphere (The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.).
How can I check Go dependencies for CVE-2024-35183?
Run the dependency tree command: 'inspect dependencies for github.com/wolfi-dev/wolfictl'. 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-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"
  }
}