CVE-2022-31098: Github.com/weaveworks/weave gitops Weave GitOps Leaked Cluster Credentials Vulnerability

CRITICAL
Advisory Identifier: GHSA-xggc-qprg-x6mw
CVSS 9.0
CWE-532 CWE-209 CWE-538 CWE-200
Published
Advisory Summary

CVE-2022-31098 is a CRITICAL (CVSS 9.0) weave gitops leaked cluster credentials vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Github.com/weaveworks/weave gitops libraries in the Go ecosystem. The issue involves weave gitops leaked cluster credentials into logs on connection errors. Remediation is available by upgrading affected packages to version 0.8.1-rc.6.

CVE-2022-31098 at a Glance

CVE Identifier CVE-2022-31098
GHSA Identifier GHSA-xggc-qprg-x6mw
Severity CRITICAL
CVSS v3.1 Base Score 9.0
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Github.com/weaveworks/weave gitops
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.0

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

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

How to Fix CVE-2022-31098

To remediate this vulnerability, upgrade all affected Github.com/weaveworks/weave gitops 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/weaveworks/weave-gitops fixed: 0.8.1-rc.6
Upgrade github.com/weaveworks/weave-gitops to 0.8.1-rc.6
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/weaveworks/weave-gitops

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-31098, inspect your project dependencies for Github.com/weaveworks/weave gitops:

inspect dependencies for github.com/weaveworks/weave-gitops

Analyze the terminal output to locate any version of Github.com/weaveworks/weave gitops in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.1-rc.6), 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-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. In Github.com/weaveworks/weave gitops, 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 A vulnerability in the logging of Weave GitOps could allow an authenticated remote attacker to view sensitive cluster configurations, aka KubeConfg, of registered Kubernetes clusters, including the service account tokens in plain text from Weave GitOps's pod logs on the management cluster. An unauthorized remote attacker can also view these sensitive configurations from external log storage if enabled by the management cluster. This vulnerability is due to the client factory dumping cluster configurations and their service account tokens when the cluster manager tries to connect to an API server of a registered cluster, and a connection error occurs. An attacker could exploit this vulnerability by either accessing logs of a pod of Weave GitOps, or from external log storage and obtaining all cluster configurations of registered clusters. A successful exploit could allow the attacker to use those cluster configurations to manage the registered Kubernetes clusters. ### Patches This vulnerability has been fixed by commit 567356f471353fb5c676c77f5abc2a04631d50ca. Users should upgrade to Weave GitOps core version >= v0.8.1-rc.6 released on 31/05/2022. ### Workarounds There is no workaround for this vulnerability. ### References Disclosed by Stefan Prodan, Principal Engineer, Weaveworks. ### For more information If you have any questions or comments about this advisory: * Open an issue in [Weave GitOps repository](https://github.com/weaveworks/weave-gitops) * Email us at [support@weave.works](mailto:support@weave.works)

CVE-2022-31098 Affected Github.com/weaveworks/weave gitops Versions

1 component(s)
Fixed Versions:
0.8.1-rc.6
Product / Package Ecosystem Affected Versions Fixed Version
github.com/weaveworks/weave-gitops
Go
< 0.8.1-rc.6
0.8.1-rc.6

References

Frequently Asked Questions

What is CVE-2022-31098?
CVE-2022-31098 is a security vulnerability in Github.com/weaveworks/weave gitops involving Weave GitOps leaked cluster credentials into logs on connection errors under CWE-532: Insertion of Sensitive Information into Log File.
Which Github.com/weaveworks/weave gitops versions are affected?
Affected versions include releases prior to 0.8.1-rc.6 across affected packages: github.com/weaveworks/weave-gitops.
What version fixes CVE-2022-31098?
Upgrading to 0.8.1-rc.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/weaveworks/weave-gitops affected?
Yes, github.com/weaveworks/weave-gitops is affected in releases prior to 0.8.1-rc.6. Upgrade your dependency to 0.8.1-rc.6 or later.
What is the CVSS score of CVE-2022-31098?
CVE-2022-31098 has a CVSS v3.1 base score of 9.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2022-31098?
CVE-2022-31098 is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check Go dependencies for CVE-2022-31098?
Run the dependency tree command: 'inspect dependencies for github.com/weaveworks/weave-gitops'. 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-xggc-qprg-x6mw",
  "modified" : "2022-06-23T17:40:34Z",
  "published" : "2022-06-23T17:40:34Z",
  "aliases" : [ "CVE-2022-31098" ],
  "summary" : "Weave GitOps leaked cluster credentials into logs on connection errors",
  "details" : "### Impact\nA vulnerability in the logging of Weave GitOps could allow an authenticated remote attacker to view sensitive cluster configurations, aka KubeConfg, of registered Kubernetes clusters, including the service account tokens in plain text from Weave GitOps's pod logs on the management cluster. An unauthorized remote attacker can also view these sensitive configurations from external log storage if enabled by the management cluster.\n\nThis vulnerability is due to the client factory dumping cluster configurations and their service account tokens when the cluster manager tries to connect to an API server of a registered cluster, and a connection error occurs. An attacker could exploit this vulnerability by either accessing logs of a pod of Weave GitOps, or from external log storage and obtaining all cluster configurations of registered clusters.\n\nA successful exploit could allow the attacker to use those cluster configurations to manage the registered Kubernetes clusters.\n\n### Patches\nThis vulnerability has been fixed by commit 567356f471353fb5c676c77f5abc2a04631d50ca. Users should upgrade to Weave GitOps core version >= v0.8.1-rc.6 released on 31/05/2022.\n\n### Workarounds\nThere is no workaround for this vulnerability.\n\n### References\nDisclosed by Stefan Prodan, Principal Engineer, Weaveworks.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Weave GitOps repository](https://github.com/weaveworks/weave-gitops)\n* Email us at [support@weave.works](mailto:support@weave.works)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/weaveworks/weave-gitops"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.1-rc.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.8.1-rc.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/weaveworks/weave-gitops/security/advisories/GHSA-xggc-qprg-x6mw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31098"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/weaveworks/weave-gitops/commit/567356f471353fb5c676c77f5abc2a04631d50ca"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/weaveworks/weave-gitops"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-209", "CWE-532", "CWE-538" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-23T17:40:34Z",
    "nvd_published_at" : "2022-06-27T22:15:00Z"
  }
}