github.com/rancher/rancher

CVE-2022-45157

CVE-2022-45157 is a high-severity security vulnerability in github.com/rancher/rancher (go), affecting versions >= 2.9.0, < 2.9.3. It is fixed in 2.9.3, 2.8.9.

Key facts
CVSS score
9.1
High
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
github.com/rancher/rancher
Fixed in
2.9.3, 2.8.9
Disclosed
2022

Summary

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: Reach out to the SUSE Rancher Security team for security related inquiries. Open an issue in the Rancher repository. Verify with our support matrix and product support lifecycle.

Impact

Severity and exposure

CVE-2022-45157 has a CVSS score of 9.1 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (2.9.3, 2.8.9). Upgrading removes the vulnerable code path.

Affected versions

go

  • github.com/rancher/rancher (>= 2.9.0, < 2.9.3)
  • github.com/rancher/rancher (>= 2.7.0, < 2.8.9)

Security releases

  • github.com/rancher/rancher → 2.9.3 (go)
  • github.com/rancher/rancher → 2.8.9 (go)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2022-45157 is reachable in your applications. Explore open-source security for your team.

See if CVE-2022-45157 is reachable in your applications. Get a demo

Already deployed Kodem? See CVE-2022-45157 in your environment

Remediation advice

Upgrade the following packages to resolve this vulnerability:

  • Upgrade github.com/rancher/rancher to 2.9.3 or later
  • Upgrade github.com/rancher/rancher to 2.8.9 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2022-45157

What is CVE-2022-45157?

CVE-2022-45157 is a high-severity security vulnerability in github.com/rancher/rancher (go), affecting versions >= 2.9.0, < 2.9.3. It is fixed in 2.9.3, 2.8.9.

How severe is CVE-2022-45157?

CVE-2022-45157 has a CVSS score of 9.1 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which versions of github.com/rancher/rancher are affected by CVE-2022-45157?

github.com/rancher/rancher (go) versions >= 2.9.0, < 2.9.3 is affected.

Is there a fix for CVE-2022-45157?

Yes. CVE-2022-45157 is fixed in 2.9.3, 2.8.9. Upgrade to this version or later.

Is CVE-2022-45157 exploitable, and should I be worried?

Whether CVE-2022-45157 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2022-45157 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2022-45157?
  • Upgrade github.com/rancher/rancher to 2.9.3 or later
  • Upgrade github.com/rancher/rancher to 2.8.9 or later

Stop the waste.
Protect your environment with Kodem.