Miggo Logo

CVE-2023-32199: Rancher user retains access to clusters despite Global Role removal

4.3

CVSS Score
3.1

Basic Information

EPSS Score
-
Published
10/24/2025
Updated
10/24/2025
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/rancher/ranchergo< 0.0.0-20251014212116-7faa74a968c20.0.0-20251014212116-7faa74a968c2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability, CVE-2023-32199, allows a Rancher user to retain administrative access to clusters even after the GlobalRole or GlobalRoleBinding granting this access has been removed. The root cause is the persistence of ClusterRoleBindings that grant cluster-admin privileges.

My analysis of the patch identified three key functions involved in this process:

  1. rbac.grbHandler.sync: This is the most critical function related to the vulnerability. As the controller for GlobalRoleBindings, it is responsible for managing their lifecycle. The code explicitly ignores deletion events (obj.DeletionTimestamp != nil), which means it fails to trigger the necessary cleanup of the associated ClusterRoleBinding. This omission is the direct cause of the orphaned resource.

  2. rbac.grbHandler.ensureClusterAdminBinding and rbac.clusterHandler.doSync: These two functions are responsible for creating the ClusterRoleBindings in the first place. They are considered part of the vulnerable process because they create resources without a proper lifecycle management mechanism, such as an owner reference, that would ensure they are garbage collected when the parent GlobalRoleBinding is deleted. The patch modifies these functions to add annotations, which allows a new, separate cleanup controller to identify and manage these bindings, confirming they are the source of the orphaned resources.

The patch introduces a new background cleaner (crbCleaner) to periodically scan for and mark orphaned ClusterRoleBindings that were created by the vulnerable functions. This confirms that the original controllers lacked the necessary cleanup logic. Therefore, any runtime profile taken during the setup of the vulnerable state would show calls to ensureClusterAdminBinding or doSync, and the failure to clean up is centered in the grbHandler.sync function's lack of action on deletion.

Vulnerable functions

rbac.grbHandler.sync
pkg/controllers/managementuser/rbac/globalrolebinding_handler.go
This function is the controller for GlobalRoleBinding objects. Its failure to handle deletion events is the primary cause of the vulnerability. When a user's administrative role is revoked by deleting the GlobalRoleBinding, this function should trigger the deletion of the corresponding ClusterRoleBinding that grants cluster access. By doing nothing, it leaves the ClusterRoleBinding orphaned and the user's access intact.
rbac.grbHandler.ensureClusterAdminBinding
pkg/controllers/managementuser/rbac/globalrolebinding_handler.go
This function is responsible for creating a ClusterRoleBinding that grants a user 'cluster-admin' privileges based on a GlobalRoleBinding. The vulnerability stems from the fact that the created ClusterRoleBinding is not automatically cleaned up. This function is a key part of the workflow that creates the orphaned resource. During an exploit, this function would have been called to grant the initial access.
rbac.clusterHandler.doSync
pkg/controllers/managementuser/rbac/cluster_handler.go
This function syncs permissions for global admins upon cluster changes, creating 'cluster-admin' ClusterRoleBindings. Like `ensureClusterAdminBinding`, it creates resources that are not garbage collected when the user's global admin role is removed, contributing to the vulnerable state. This function would be on the execution path when setting up the permissions that are later not revoked.

WAF Protection Rules

WAF Rule

### Imp**t * vuln*r**ility **s ***n i**nti*i** wit*in R*n***r M*n***r, w**r* **t*r r*movin* * *ustom *lo**lRol* t**t *iv*s **ministr*tiv* ****ss or t** *orr*spon*in* *in*in*, t** us*r still r*t*ins ****ss to *lust*rs. T*is only *****ts *ustom *lo**l

Reasoning

T** vuln*r**ility, *V*-****-*****, *llows * R*n***r us*r to r*t*in **ministr*tiv* ****ss to *lust*rs *v*n **t*r t** *lo**lRol* or *lo**lRol**in*in* *r*ntin* t*is ****ss **s ***n r*mov**. T** root **us* is t** p*rsist*n** o* `*lust*rRol**in*in*s` t**t