Skip to main content
Vulnerability Database/CVE-2024-22031

CVE-2024-22031: Rancher Privilege Escalation Vulnerability

CVE-2024-22031 is a privilege escalation flaw in Rancher that allows users to gain unauthorized access to projects across clusters by creating duplicate project names. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-22031 Overview

CVE-2024-22031 is an authorization flaw in Rancher that allows cross-cluster privilege escalation through project namespace collisions. A user with permission to create projects in one cluster can create a project with the same name as an existing project in a different cluster. Rancher stores related resources, including Project Role Template Bindings (PRTBs) and secrets, in a namespace on the local cluster named after the project. The reused namespace grants the attacker access to the colliding project in the other cluster. The flaw is tracked as CWE-863: Incorrect Authorization.

Critical Impact

An authenticated user with project-creation rights in a single downstream cluster can gain unauthorized access to projects in other clusters managed by the same Rancher instance, breaking multi-tenant isolation.

Affected Products

  • Rancher (multi-cluster manager)
  • Downstream Kubernetes clusters managed by Rancher
  • SUSE Rancher distributions tracked in SUSE Bugzilla CVE-2024-22031

Discovery Timeline

  • 2026-10-15 - CVE-2024-22031 published to the National Vulnerability Database
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2024-22031

Vulnerability Analysis

Rancher uses project names as the identifier for the local-cluster namespace that stores a project's bindings and secrets. Project names are not globally unique across clusters. An attacker with project-creation rights in cluster B can create a project whose name matches an existing project in cluster A. Rancher then reuses the same local namespace, exposing PRTBs and secrets that belong to the project in cluster A.

The root authorization check validates that the caller may create a project in the target cluster. It does not verify that the resulting namespace is unique across the Rancher management plane. This mismatch between cluster-scoped authorization and global namespace resolution produces the privilege escalation.

Root Cause

The root cause is incorrect authorization logic (CWE-863) combined with a non-unique naming scheme. Project-scoped resources are keyed by project name rather than a cluster-qualified identifier such as clusterID/projectName. Rancher assumes the backing namespace is private to the newly created project, so PRTBs written to that namespace inherit access to any pre-existing project sharing the name.

Attack Vector

Exploitation requires authenticated access to the Rancher API with privileges to create projects in at least one downstream cluster. The attacker enumerates project names in target clusters, then creates a project with a colliding name in a cluster they already control. The newly created PRTB grants the attacker roles on resources that resolve into the shared namespace, including secrets and role bindings tied to the victim project. The attack is executed over the network against the Rancher management API without user interaction.

No verified proof-of-concept code has been published. See the GitHub Security Advisory GHSA-8h6m-wv39-239m for the maintainer's technical description.

Detection Methods for CVE-2024-22031

Indicators of Compromise

  • Creation of a project in one downstream cluster whose name matches an existing project in another cluster managed by the same Rancher instance.
  • Unexpected PRTB (management.cattle.io/v3/ProjectRoleTemplateBinding) objects referencing user subjects that were not previously bound to the victim project.
  • Access to secrets inside a project namespace from service accounts or users that belong to a different cluster's project.

Detection Strategies

  • Audit Rancher API logs for POST requests to /v3/projects and correlate the spec.displayName field across clusters to surface name collisions.
  • Query the Rancher management cluster for duplicate project names across different clusterId values and alert on new duplicates.
  • Review Kubernetes audit logs on the local cluster for create and update events against PRTB resources in project-named namespaces.

Monitoring Recommendations

  • Forward Rancher server and Kubernetes audit logs to a centralized logging or SIEM platform and build detections on cross-cluster project name reuse.
  • Alert on PRTB membership changes that add principals from a different cluster's identity scope than the project's original owner.
  • Baseline the set of project names per cluster and flag deviations introduced by non-admin users.

How to Mitigate CVE-2024-22031

Immediate Actions Required

  • Upgrade Rancher to the fixed release identified in GHSA-8h6m-wv39-239m.
  • Review existing projects across all managed clusters and remove or rename any colliding project names created by non-administrative users.
  • Revoke PRTBs and rotate secrets associated with any project namespace that shows signs of cross-cluster access.

Patch Information

SUSE and the Rancher maintainers released fixes tracked in the SUSE Bugzilla entry and the upstream GitHub Security Advisory GHSA-8h6m-wv39-239m. Apply the vendor-recommended Rancher version for your release line and restart the Rancher management workloads.

Workarounds

  • Restrict project-creation privileges to trusted administrators until all managed clusters are patched.
  • Enforce a naming convention that embeds a cluster identifier in every project displayName to prevent accidental or malicious collisions.
  • Use Rancher global roles and OPA/Gatekeeper policies to deny project creation requests whose names already exist elsewhere in the Rancher instance.
bash
# Enumerate duplicate project names across clusters using kubectl against the Rancher local cluster
kubectl get projects.management.cattle.io -A \
  -o jsonpath='{range .items[*]}{.spec.clusterName}{"\t"}{.spec.displayName}{"\n"}{end}' \
  | sort -k2 | awk '{print $2}' | uniq -d

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.