CVE-2023-32199: Rancher user retains access to clusters despite Global Role removal
4.3
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/rancher/rancher | go | < 0.0.0-20251014212116-7faa74a968c2 | 0.0.0-20251014212116-7faa74a968c2 |
Vulnerability Intelligence
Miggo AI
Root 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:
-
rbac.grbHandler.sync: This is the most critical function related to the vulnerability. As the controller forGlobalRoleBindings, 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 associatedClusterRoleBinding. This omission is the direct cause of the orphaned resource. -
rbac.grbHandler.ensureClusterAdminBindingandrbac.clusterHandler.doSync: These two functions are responsible for creating theClusterRoleBindingsin 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 parentGlobalRoleBindingis 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.syncpkg/controllers/managementuser/rbac/globalrolebinding_handler.go
rbac.grbHandler.ensureClusterAdminBindingpkg/controllers/managementuser/rbac/globalrolebinding_handler.go
rbac.clusterHandler.doSyncpkg/controllers/managementuser/rbac/cluster_handler.go