CVE-2022-45157: Github.com/rancher/rancher Exposure Of VSphere's CPI And Vulnerability

HIGH
Advisory Identifier: GHSA-xj7w-r753-vj8v
CVSS 9.1
CWE-522
Published
Advisory Summary

CVE-2022-45157 is a HIGH (CVSS 9.1) exposure of vsphere's cpi and vulnerability (CWE-522: Insufficiently Protected Credentials) affecting Github.com/rancher/rancher libraries in the Go ecosystem. The issue involves exposure of vsphere's cpi and csi credentials in rancher. Remediation is available by upgrading affected packages to version 2.9.3, 2.8.9.

CVE-2022-45157 at a Glance

CVE Identifier CVE-2022-45157
GHSA Identifier GHSA-xj7w-r753-vj8v
Severity HIGH
CVSS v3.1 Base Score 9.1
CWE Classification CWE-522: Insufficiently Protected Credentials
Affected Product Github.com/rancher/rancher
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.1

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:N/S:C/C:H/I:L/A:L).

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

How to Fix CVE-2022-45157

To remediate this vulnerability, upgrade all affected Github.com/rancher/rancher 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/rancher/rancher fixed: 2.9.3
Upgrade github.com/rancher/rancher to 2.9.3
github.com/rancher/rancher fixed: 2.8.9
Upgrade github.com/rancher/rancher to 2.8.9
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/rancher/rancher

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-45157, inspect your project dependencies for Github.com/rancher/rancher:

inspect dependencies for github.com/rancher/rancher

Analyze the terminal output to locate any version of Github.com/rancher/rancher in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.9.3), 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-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In Github.com/rancher/rancher, 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 has been identified in the way that Rancher stores vSphere's CPI (Cloud Provider Interface) and CSI (Container Storage Interface) credentials used to deploy clusters through the vSphere cloud provider. This issue leads to the vSphere CPI and CSI passwords being stored in a plaintext object inside Rancher. This vulnerability is only applicable to users that deploy clusters in vSphere environments. The exposed passwords were accessible in the following objects: - Can be accessed by users that are cluster members of the provisioned clusters: - When provisioning a new cluster with the vSphere cloud provider through Rancher's UI (user interface), Cluster Templates and Terraform on the object `provisioning.cattle.io` in `spec.rkeConfig.chartValues.rancher-vsphere-cpi` and `spec.rkeConfig.chartValues.rancher-vsphere-csi`. - On the object `rke.cattle.io.rkecontrolplane` in `spec.chartValues.rancher-vsphere-cpi` and `spec.chartValues.rancher-vsphere-csi`. - Can be accessed by users with privileged access to the clusters' infrastructure (host OS): - Inside the `plan` files in the provisioned downstream clusters' filesystems. **Note:** if you believe that the vSphere credentials might have been accessed by unauthorized users, it's highly recommended to change them, after updating Rancher to a patched version. Please consult the associated [MITRE ATT&CK - Technique - Credential Access](https://attack.mitre.org/tactics/TA0006/) for further information about this category of attack. ### Patches Patched versions include Rancher releases **2.8.9 and 2.9.3**. After updating your environment to one of the patched Rancher's versions, it's mandatory to execute [this script](https://github.com/rancherlabs/support-tools/tree/master/migrate-vsphere-clusters) that provides an automated way to mitigate any vulnerable leftover vSphere clusters' credentials within Rancher's local cluster. This script doesn't need to be executed in case you are installing a fresh and new environment. The script will fetch all objects in Rancher's local cluster, loops through them, if the affected vSphere charts are present, then it extracts the `username` and `password` parameters into a secret in the `fleet-default` namespace for both with the appropriate annotation to synchronize them to the downstream clusters. Finally, it updates the cluster's `chartValues` to reference those secrets rather than existing plaintext values. The script confirms on write operations, as well as backs up configurations of the cluster objects before operating so rolling back is simple. To run the script, fetch the `kubeconfig` for your local cluster and run with `KUBECONFIG=/path/to/kubeconfig.yml bash migrate.sh`. The script is idempotent and can be run multiple times safely if you want to validate just one at a time. **Notes:** - The [feature flag](https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/installation-references/feature-flags) `provisioningprebootstrap` must be enabled after updating to one of the patched versions. This feature flag is also mandatory when installing a new cluster. - **Rancher 2.7 release line is not receiving a backport security patch for this vulnerability.** For users running Rancher 2.7 with vSphere provisioning and that are concerned with this security issue, the recommendation is to update Rancher to one of the patched versions by following the standard update procedure based on the 2.7 version that is being used. Refer to the release notes for the proper update process for [2.8.9](https://github.com/rancher/rancher/releases/tag/v2.8.9) and [2.9.3](https://github.com/rancher/rancher/releases/tag/v2.9.3). ### Workarounds Besides only granting access to Rancher to trusted users and not allowing direct access to untrusted users to the clusters' infrastructure, there is no direct workaround for this security issue, except updating Rancher to one of the patched versions. ### References If you have any questions or comments about this advisory: - Reach out to the [SUSE Rancher Security team](https://github.com/rancher/rancher/security/policy) for security related inquiries. - Open an issue in the [Rancher](https://github.com/rancher/rancher/issues/new/choose) repository. - Verify with our [support matrix](https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/) and [product support lifecycle](https://www.suse.com/lifecycle/).

CVE-2022-45157 Affected Github.com/rancher/rancher Versions

2 component(s)
Fixed Versions:
2.9.32.8.9
Product / Package Ecosystem Affected Versions Fixed Version
github.com/rancher/rancher
Go
≥ 2.9.0
< 2.9.3
2.9.3
github.com/rancher/rancher
Go
≥ 2.7.0
< 2.8.9
2.8.9

References

Frequently Asked Questions

What is CVE-2022-45157?
CVE-2022-45157 is a security vulnerability in Github.com/rancher/rancher involving Exposure of vSphere's CPI and CSI credentials in Rancher under CWE-522: Insufficiently Protected Credentials.
Which Github.com/rancher/rancher versions are affected?
Affected versions include releases prior to 2.9.3, 2.8.9 across affected packages: github.com/rancher/rancher.
What version fixes CVE-2022-45157?
Upgrading to 2.9.3, 2.8.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/rancher/rancher affected?
Yes, github.com/rancher/rancher is affected in releases prior to 2.9.3, 2.8.9. Upgrade your dependency to 2.9.3, 2.8.9 or later.
What is the CVSS score of CVE-2022-45157?
CVE-2022-45157 has a CVSS v3.1 base score of 9.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L.
What CWE is associated with CVE-2022-45157?
CVE-2022-45157 is classified under CWE-522: Insufficiently Protected Credentials (The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.).
How can I check Go dependencies for CVE-2022-45157?
Run the dependency tree command: 'inspect dependencies for github.com/rancher/rancher'. 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-xj7w-r753-vj8v",
  "modified" : "2024-11-13T16:29:20Z",
  "published" : "2024-10-25T19:35:55Z",
  "aliases" : [ "CVE-2022-45157" ],
  "summary" : "Exposure of vSphere's CPI and CSI credentials in Rancher",
  "details" : "### Impact\n\nA vulnerability has been identified in the way that Rancher stores vSphere's CPI (Cloud Provider Interface) and CSI (Container Storage Interface) credentials used to deploy clusters through the vSphere cloud provider. This issue leads to the vSphere CPI and CSI passwords being stored in a plaintext object inside Rancher. This vulnerability is only applicable to users that deploy clusters in vSphere environments.\n\nThe exposed passwords were accessible in the following objects:\n\n- Can be accessed by users that are cluster members of the provisioned clusters:\n  - When provisioning a new cluster with the vSphere cloud provider through Rancher's UI (user interface), Cluster Templates and Terraform on the object `provisioning.cattle.io` in `spec.rkeConfig.chartValues.rancher-vsphere-cpi` and `spec.rkeConfig.chartValues.rancher-vsphere-csi`.\n  - On the object `rke.cattle.io.rkecontrolplane` in `spec.chartValues.rancher-vsphere-cpi` and `spec.chartValues.rancher-vsphere-csi`.\n- Can be accessed by users with privileged access to the clusters' infrastructure (host OS):\n  - Inside the `plan` files in the provisioned downstream clusters' filesystems.\n\n**Note:** if you believe that the vSphere credentials might have been accessed by unauthorized users, it's highly recommended to change them, after updating Rancher to a patched version.\n\nPlease consult the associated  [MITRE ATT&CK - Technique -  Credential Access](https://attack.mitre.org/tactics/TA0006/) for further information about this category of attack.\n\n### Patches\n\nPatched versions include Rancher releases **2.8.9 and 2.9.3**.\n\nAfter updating your environment to one of the patched Rancher's versions, it's mandatory to execute [this script](https://github.com/rancherlabs/support-tools/tree/master/migrate-vsphere-clusters) that provides an automated way to mitigate any vulnerable leftover vSphere clusters' credentials within Rancher's local cluster. This script doesn't need to be executed in case you are installing a fresh and new environment.\n\nThe script will fetch all objects in Rancher's local cluster,  loops through them, if the affected vSphere charts are present, then it extracts the `username` and `password` parameters into a secret in the `fleet-default` namespace for both with the appropriate annotation to synchronize them to the downstream clusters. Finally, it updates the cluster's `chartValues` to reference those secrets rather than existing plaintext values.\n\nThe script confirms on write operations, as well as backs up configurations of the cluster objects before operating so rolling back is simple.\n\nTo run the script, fetch the `kubeconfig` for your local cluster and run with `KUBECONFIG=/path/to/kubeconfig.yml bash migrate.sh`. The script is idempotent and can be run multiple times safely if you want to validate just one at a time.\n\n**Notes:**\n\n- The [feature flag](https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/installation-references/feature-flags) `provisioningprebootstrap` must be enabled after updating to one of the patched versions. This feature flag is also mandatory when installing a new cluster.\n- **Rancher 2.7 release line is not receiving a backport security patch for this vulnerability.** For users running Rancher 2.7 with vSphere provisioning and that are concerned with this security issue, the recommendation is to update Rancher to one of the patched versions by following the standard update procedure based on the 2.7 version that is being used. Refer to the release notes for the proper update process for [2.8.9](https://github.com/rancher/rancher/releases/tag/v2.8.9) and [2.9.3](https://github.com/rancher/rancher/releases/tag/v2.9.3).\n\n### Workarounds\n\nBesides only granting access to Rancher to trusted users and not allowing direct access to untrusted users to the clusters' infrastructure, there is no direct workaround for this security issue, except updating Rancher to one of the patched versions.\n\n### References\n\nIf you have any questions or comments about this advisory:\n- Reach out to the [SUSE Rancher Security team](https://github.com/rancher/rancher/security/policy) for security related inquiries.\n- Open an issue in the [Rancher](https://github.com/rancher/rancher/issues/new/choose) repository.\n- Verify with our [support matrix](https://www.suse.com/suse-rancher/support-matrix/all-supported-versions/) and [product support lifecycle](https://www.suse.com/lifecycle/).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:L/SC:H/SI:L/SA:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/rancher/rancher"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.9.0"
      }, {
        "fixed" : "2.9.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/rancher/rancher"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7.0"
      }, {
        "fixed" : "2.8.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rancher/rancher/security/advisories/GHSA-xj7w-r753-vj8v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-45157"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.suse.com/show_bug.cgi?id=CVE-2022-45157"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rancher/rancher"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-522" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-25T19:35:55Z",
    "nvd_published_at" : "2024-11-13T14:15:14Z"
  }
}