github.com/rancher/rancher

CVE-2022-31247

CVE-2022-31247 is a critical-severity incorrect authorization vulnerability in github.com/rancher/rancher (go), affecting versions >= 2.5.0, <= 2.5.15. It is fixed in 2.5.16, 2.6.7.

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

Summary

Impact An issue was discovered in Rancher versions up to and including 2.5.15 and 2.6.6 where a flaw with authorization logic allows privilege escalation through cluster role template binding (CRTB) and project role template binding (PRTB). This issue does not affect the local cluster, it affects only downstream clusters. The vulnerability can be exploited by any user who has permissions to create/edit cluster role template bindings or project role template bindings (such as cluster-owner, manage cluster members, project-owner and manage project members) to gain owner permission in another project in the same cluster or in another project on a different downstream cluster. The user must have kubectl access in the local cluster to exploit this scenario. This can only be abused to gain cluster-owner permission on a different downstream cluster if the user is already cluster-owner on at least one downstream cluster. Example of a modified CRTB (note: the clusterName points to the cluster ID of the cluster that the privileges will be escalated and namespace points to the current cluster ID that the user has permissions): An artifact to flag the exploitation of this issue is that the namespace of the CRTB/PRTB will not match the cluster name (clusterName) of the CRTB/PRTB. For example, every CRTB in the c-123xyz namespace should have a cluster name of c-123xyz. If instead, the cluster name is c-abc567, for example, this is likely a result of a user exploiting this flaw. For more information about cluster and project roles, please consult Rancher's documentation. Patches Patched versions include releases 2.5.16, 2.6.7 and later versions. Workarounds Limit access in Rancher to trusted users. There is not a direct mitigation besides upgrading to the patched Rancher versions. Important: It is highly advised to check the local and downstream clusters for potential unrecognized CRTBs (kubectl get clusterroletemplatebindings -A) and PRTBs (kubectl get projectroletemplatebindings -A) assignments. The ability to add other users to projects and clusters is a highly-privileged permission which may result in users being able to operate beyond their explicitly specified RBAC. It is recommended that this permission be granted selectively. The following script can be used as a helper to detect possible deviations of CRTBs and PRTBs that do not match the expected value. Further investigation is required to determine if the flagged objects were maliciously modified or not. The script requires kubectl access to the local cluster and the jq command. For more information If you have any questions or comments about this advisory: Reach out to SUSE Rancher Security team for security related inquiries. Open an issue in Rancher repository. Verify our support matrix and product support lifecycle.

Impact

What is incorrect authorization?

The application does not correctly enforce access controls, allowing a principal to access resources or operations beyond their granted permissions. Typical impact: unauthorized data access or execution of privileged operations.

Severity and exposure

CVE-2022-31247 has a CVSS score of 9.1 (Critical). The vector is network-reachable, high 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.5.16, 2.6.7). Upgrading removes the vulnerable code path.

Affected versions

go

  • github.com/rancher/rancher (>= 2.5.0, <= 2.5.15)
  • github.com/rancher/rancher (>= 2.6.0, <= 2.6.6)

Security releases

  • github.com/rancher/rancher → 2.5.16 (go)
  • github.com/rancher/rancher → 2.6.7 (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-31247 is reachable in your applications. Explore open-source security for your team.

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

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

Remediation advice

Upgrade the following packages to resolve this vulnerability:

  • Upgrade github.com/rancher/rancher to 2.5.16 or later
  • Upgrade github.com/rancher/rancher to 2.6.7 or later

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

Frequently asked questions about CVE-2022-31247

What is CVE-2022-31247?

CVE-2022-31247 is a critical-severity incorrect authorization vulnerability in github.com/rancher/rancher (go), affecting versions >= 2.5.0, <= 2.5.15. It is fixed in 2.5.16, 2.6.7. The application does not correctly enforce access controls, allowing a principal to access resources or operations beyond their granted permissions.

How severe is CVE-2022-31247?

CVE-2022-31247 has a CVSS score of 9.1 (Critical). 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-31247?

github.com/rancher/rancher (go) versions >= 2.5.0, <= 2.5.15 is affected.

Is there a fix for CVE-2022-31247?

Yes. CVE-2022-31247 is fixed in 2.5.16, 2.6.7. Upgrade to this version or later.

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

Whether CVE-2022-31247 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-31247 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-31247?
  • Upgrade github.com/rancher/rancher to 2.5.16 or later
  • Upgrade github.com/rancher/rancher to 2.6.7 or later

Stop the waste.
Protect your environment with Kodem.