Skip to content

GHSA-xj7w-r753-vj8v CVE-2022-45157 GO-2024-3223

Exposure of vSphere's CPI and CSI credentials in Rancher

Critical Go
Severity
0.0 / 10
Critical · CVSS 4.0
Exploit chance (EPSS)
0.44%
Chance of exploitation in the next 30 days. Higher than 38.16% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-522 Insufficiently Protected Credentials
Fix
2.9.3
Upgrade github.com/rancher/rancher to this version or later

Description

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 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 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 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 and 2.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:

Affected versions

Go

PackageVulnerableFixed in
github.com/rancher/rancher
>= 2.9.0, < 2.9.3
2.9.3
github.com/rancher/rancher
>= 2.7.0, < 2.8.9
2.8.9
github.com/rancher/rancher
all versions
No fix yet

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

github.com/rancher/rancher Go → 2.9.3

go
go get github.com/rancher/rancher@v2.9.3 && go mod tidy

Severity breakdown

CVSS 4.0 0.0

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

Attack vector
Network
Attack complexity
Low
Attack requirements
None
Privileges required
Low
User interaction
None
Confidentiality (vulnerable system)
High
Integrity (vulnerable system)
Low
Availability (vulnerable system)
Low
Confidentiality (subsequent systems)
High
Integrity (subsequent systems)
Low
Availability (subsequent systems)
Low

CVSS 3.1 9.1

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
Low
Availability
Low

Weakness

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 to prevent it
  • Architecture and Design: Use an appropriate security mechanism to protect the credentials.
  • Architecture and Design: Make appropriate use of cryptography to protect the credentials.
  • Implementation: Use industry standards to protect the credentials (e.g. LDAP, keystore, etc.).

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-4j6x-2764-m8gh
Rancher has over-inclusive team membership expansion in GitHub App authentication provider
High Also affects github.com/rancher/rancher
GHSA-vx8h-4prv-g744
Rancher has Privilege Escalation from Project Owner to Host
High Also affects github.com/rancher/rancher
GHSA-mhc6-2gfq-xx62
Rancher vulnerable to command injection through unsanitized YAML parameter
Critical Also affects github.com/rancher/rancher
GHSA-5v3h-x4wf-5c35
Rancher Extensions have arbitrary file access via path traversal
High Also affects github.com/rancher/rancher
GHSA-gqf8-rvrh-g7w6
Rancher cloud credentials can be used through proxy API by users without access
Critical Also affects github.com/rancher/rancher
GHSA-hwm2-4ph6-w6m5
Rancher's restricted PodSecurityPolicy does not prevent containers from running as a privileged user
High Also affects github.com/rancher/rancher
GHSA-mc24-7m59-4q5p
Rancher CLI skips TLS verification on Rancher CLI login command
Medium Also affects github.com/rancher/rancher
GHSA-mw39-9qc2-f7mg
Rancher exposes sensitive information through audit logs
Medium Also affects github.com/rancher/rancher
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor