CVE-2022-31247Critical· 9.1▾ MidnightRancher has downstream cluster privilege escalation through cluster and project role template binding (CRTB/PRTB)
▾ Midnight zone — Critical, or high with PoC / in-the-wild
impact 50.1 · likelihood 0.2 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 9.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via OSV
Last analysed / modified upstream
0.8%
0.8% → 1.0%
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):
kubectl edit clusterroletemplatebindings crtb-<crtb-ID> -n c-<cluster-ID>
---
apiVersion: management.cattle.io/v3
clusterName: <ID-of-the-cluster-to-escalate>
kind: ClusterRoleTemplateBinding
metadata:
annotations:
<omitted>
finalizers:
- <omitted>
generateName: crtb-
labels:
<omitted>
cattle.io/creator: norman
name: crtb-<crtb-ID>
namespace: c-<current-cluster-ID>
roleTemplateName: cluster-owner
userName: u-<user-ID>
userPrincipalName: local://u-<user-ID>
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.
Patched versions include releases 2.5.16, 2.6.7 and later versions.
Limit access in Rancher to trusted users. There is not a direct mitigation besides upgrading to the patched Rancher versions.
Important:
kubectl get clusterroletemplatebindings -A) and PRTBs (kubectl get projectroletemplatebindings -A) assignments.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.
#!/usr/bin/env bash
echo "CRTBs that don't match cluster:"
kubectl get clusterroletemplatebindings -A -o=jsonpath="{range .items[?(@[email protected])]}{.metadata.name}{'\n'}{end}"
echo "PRTBs that don't match project:"
kubectl get projectroletemplatebindings -A -ojson | jq -r '.items[]|.metadata as $m|select(.projectName|endswith($m.namespace)|not)|.metadata.name'
If you have any questions or comments about this advisory:
github.com/rancher/rancher >= 2.5.0, < 2.5.16github.com/rancher/rancher >= 2.6.0, < 2.6.7Upgrade to a patched release:
github.com/rancher/rancher 2.5.16github.com/rancher/rancher 2.6.7Connected by shared product, vendor, weakness, or advisory.
CVE-2023-32196Critical· 9.1Rancher allows privilege escalation in Windows nodes due to Insecure Access Control Lists
CVE-2025-23387Medium· 5.3Rancher's SAML-based login via CLI can be denied by unauthenticated users
CVE-2026-25705High· 8.4Rancher Extensions have arbitrary file access via path traversal
CVE-2024-52281High· 8.9Rancher UI has Stored Cross-site Scripting vulnerability
CVE-2021-25320Critical· 9.9Rancher cloud credentials can be used through proxy API by users without access
CVE-2021-36775High· 8.0Rancher's Failure to delete orphaned role bindings does not revoke project level access from group based authentication