☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Rancher logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H 🐛 CWE-732
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2021-25318

CVE-2021-25318 — rancher: API group not properly specified when creating Kubernetes RBAC resources
📅 PUBLISHED: 2021-07-15 00:00 UTC 🔄 UPDATED: 2026-10-09 05:43 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix ⏳ Vendor-claimed fix: v2.5.9 — source: suse. UNVERIFIED · pending independent confirmation. how verification works →
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 1.05%
👁️
1.05% probability
26.3× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1222
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: USA License: Open Source
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 8.8
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: L Privileges Required Low
UI: N User Interaction None
S: U Scope Unchanged
C: H Confidentiality High
I: H Integrity High
A: H Availability High
8.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2021-25318 is an Incorrect Permission Assignment for Critical Resource vulnerability in Rancher, a widely-deployed Kubernetes management platform. The flaw allows authenticated users within a Kubernetes cluster to modify RBAC (Role-Based Access Control) resources they should not have access to, effectively enabling privilege escalation within the cluster. Affected are all Rancher deployments running versions prior to 2.5.9 and prior to 2.4.16, which covers a significant portion of production Rancher installations. With a CVSS score of 8.8, this vulnerability poses a critical risk because successful exploitation grants unauthorized users the ability to alter Kubernetes RBAC policies, potentially leading to full cluster compromise.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Technical Analysis

The vulnerability resides in how Rancher creates Kubernetes RBAC resources when managing cluster member access. The CNA title indicates that the "API group not properly specified when creating Kubernetes RBAC resources" — meaning that when Rancher provisions RoleBindings or ClusterRoleBindings on behalf of users, it fails to correctly specify the RBAC API group. Kubernetes RBAC objects live in the rbac.authorization.k8s.io API group. If this group is omitted or incorrectly specified during resource creation, the Kubernetes API server may interpret the resource differently than intended.

The NVD description characterizes this as an "Incorrect Permission Assignment for Critical Resource" issue (CWE-732). The consequence is that authenticated users inside a cluster can create or modify RBAC-related resources they should not have access to, potentially granting themselves elevated privileges. The attack vector is within the cluster — a user with some level of cluster access (even low-privileged) can exploit the flaw to escalate their permissions.

At the mechanism level, the flaw likely stems from Rancher's authorization logic that determines whether a user has the right to create/modify RBAC bindings. Because the API group isn't properly specified, Rancher's own RBAC validation may fail to match the request against the correct API group's permissions, allowing requests that should be denied. The Kubernetes API server itself enforces RBAC authorization, but if Rancher's impersonation or proxying layer misidentifies the resource type due to the missing API group, the authorization decision may be incorrect.

Insufficient technical detail is provided in the public description to identify the exact code path or function involved. The fix versions (2.4.16 and 2.5.9) indicate the vendor acknowledged the issue and addressed it, but no patch source has been confirmed in our tracked intelligence.


Exploitation Scenarios

No public PoC or exploit code is available for CVE-2021-25318. The attack chain below is inferred from the vulnerability class and NVD description.

Attack Chain:

  1. Reconnaissance / Target Identification: The attacker must be an authenticated user within a Kubernetes cluster managed by Rancher. This includes project members, cluster members, or any user Rancher has provisioned with limited access. The attacker identifies themselves as a low-privileged member of a Rancher-managed cluster.

  2. Triggering the Flaw: The attacker initiates a request to Rancher's API to create or modify a Kubernetes RBAC resource (e.g., RoleBinding, ClusterRoleBinding) for their own user or a service account they control. Because Rancher fails to properly specify the RBAC API group, the request bypasses Rancher's intended permission checks.

  3. Payload / Execution Method: At the vulnerability-class level, the attacker submits a resource creation request that should be blocked by their current role. Due to the incorrect API group specification, Rancher processes the request as if the user has the necessary permissions to create/modify the RBAC object. The attacker can then bind themselves (or a controlled service account) to a high-privilege ClusterRole such as cluster-admin or a custom role with elevated permissions.

  4. Post-Exploitation Impact: Once the attacker has modified RBAC bindings to include themselves in a privileged role, they acquire administrative control over the Kubernetes cluster. This enables them to: read secrets from any namespace, deploy malicious pods (including pods that mount host filesystems or capture workload credentials), intercept cluster network traffic, modify deployments, and potentially pivot to the underlying hosts. In managed Kubernetes environments, this could also expose cloud credentials associated with the cluster's cloud provider integration.


Impact Assessment

Business Impact: Rancher is commonly used to manage multiple Kubernetes clusters across development, staging, and production environments. A successful exploitation grants unauthorized RBAC modification capabilities, which typically escalates to full cluster-admin privileges. For enterprises, this means complete compromise of containerized workloads, loss of data confidentiality (via secret exfiltration), integrity (via workload modification), and availability (via destructive pod or namespace deletion).

Affected Systems: All Rancher-managed clusters deployed on versions 2.4.15 and earlier, and 2.5.8 and earlier. This includes on-premises, hybrid, and cloud-hosted Rancher installations.

Blast Radius: A privilege escalation in Kubernetes RBAC has a multiplicative blast radius. One compromised cluster can expose secrets shared across multiple clusters if using the same secret store. If the cluster is integrated with a cloud provider for load balancers or persistent volumes, the attacker may gain access to cloud IAM credentials. The CVSS 8.8 score reflects high confidentiality, integrity, and availability impacts with low complexity and no user interaction.


Detection Guidance

Sigma Rule

title: Rancher RBAC Modification via API Group Mismatch
id: 8f4c2a1e-5b7d-4f3a-9c1e-2d6b8a4e1f3c
status: experimental
description: Detects attempts to create or modify RBAC role bindings through Rancher API with missing or incorrect API group specification
author: Valtersit Security Research
logsource:
  product: kubernetes
  service: audit
detection:
  selection:
    verb: ["create", "patch", "update", "delete"]
    objectRef.resource: ["rolebindings", "clusterrolebindings"]
  filter_fixed:
    objectRef.apiGroup: "rbac.authorization.k8s.io"
  filter_rancher:
    user.username: "system:serviceaccount:cattle-system:*"
  condition: selection and not filter_fixed and not filter_rancher
level: high
falsepositives:
  - Legitimate cluster-admin operations creating RBAC resources
  - Rancher controller reconcile operations
tags:
  - attack.t1222
  - cve.2021-25318

YARA Rule

rule CVE_2021_25318_Rancher_RBAC_API_Group
{
    meta:
        author = "Valtersit Security Research"
        description = "Detects evidence of exploitation attempts for CVE-2021-25318 in Rancher logs"
        cve = "CVE-2021-25318"
        date = "2024-01-15"
    strings:
        $rbac_keyword = "rolebindings" ascii nocase
        $rbac_cluster = "clusterrolebindings" ascii nocase
        $api_group_missing = "\"apiGroup\":\"\"" ascii
        $api_group_absent = "apiGroup\": null" ascii
        $log_severity = "\"level\":\"warning\"" ascii
        $rancher_ctx = "rancher" ascii nocase
    condition:
        filesize < 10MB and
        ($rbac_keyword or $rbac_cluster) and
        ($api_group_missing or $api_group_absent) and
        $rancher_ctx
}

Suricata IDS Rule

alert http any any -> any any (msg:"CVE-2021-25318 Rancher RBAC API Group Access Bypass Attempt"; flow:established,to_server; content:"POST"; http_method; content:"/v3/"; http_uri; content:"rolebinding"; http_uri; content:"apiGroup"; http_client_body; pcre:"/apiGroup[\"']?\s*[:=]\s*[\"']{1,2}/Pi"; reference:cve,2021-25318; classtype:attempted-admin; sid:202101318; rev:1;)

Elastic Detection

sequence by host.name with maxspan=5m
  [ any where
    event.action in ("create", "patch", "update", "delete") and
    kubernetes.audit.object_ref.resource in ("rolebindings", "clusterrolebindings") and
    not kubernetes.audit.object_ref.api_group == "rbac.authorization.k8s.io"
  ]
  [ any where
    event.outcome == "success" and
    process.name == "rancher" or process.name == "kubectl"
  ]

Splunk SPL Query

index=kubernetes sourcetype=kube:audit
  (objectRef.resource=rolebindings OR objectRef.resource=clusterrolebindings)
  (verb=create OR verb=update OR verb=patch)
  NOT objectRef.apiGroup="rbac.authorization.k8s.io"
  | stats count by user.username, sourceIPs{}, verb, objectRef.namespace, responseStatus.code, host
  | where responseStatus.code=201 OR responseStatus.code=200
  | sort - count

Wazuh OSSEC Rule

<group name="kubernetes,rcac,rancher,">
  <rule id="100318" level="12">
    <decoded_as>json</decoded_as>
    <field name="objectRef.resource">rolebindings|clusterrolebindings</field>
    <field name="objectRef.apiGroup">!^rbac.authorization.k8s.io$</field>
    <field name="verb">create|update|patch</field>
    <description>CVE-2021-25318: Rancher RBAC modification with incorrect API group specified</description>
    <mitre>
      <id>T1222</id>
    </mitre>
    <group>rbac_modification,</group>
  </rule>
</group>

Mitigation & Patch Guidance

Patch Status: This vulnerability is marked UNPATCHED (patch confidence 0/4 — no patch evidence from any tracked source). While the NVD description references fixed versions (2.5.9 and 2.4.16), our tracked patch sources have not confirmed vendor advisories or CVE-2021-25318-specific fix release artifacts. Organizations should verify with SUSE/Rancher support whether their exact build addresses this CVE.

Immediate Mitigations:

  • Apply an RBAC admission webhook that validates that all RoleBinding/ClusterRoleBinding resources explicitly specify apiGroup: rbac.authorization.k8s.io.
  • Enforce Kubernetes Pod Security Policies / Pod Security Admission to restrict privileged workloads if RBAC is compromised.
  • Audit existing RoleBindings and ClusterRoleBindings for unauthorized subjects; search for bindings to cluster-admin or elevated roles that were not created by authorized administrators.
  • Restrict access to Rancher v3 API endpoints that proxy Kubernetes resource creation; use network policies to limit which IPs can reach the Rancher management API.
  • Enable Kubernetes audit logging to SystemLog or an external SIEM for rolebinding events if not already configured.

Upgrade / Patch Steps:

  1. Confirm your Rancher version: run kubectl get deployment rancher -n cattle-system -o jsonpath='{.spec.template.spec.containers[0].image}'.
  2. If on an affected branch (2.4.x ≤ 2.4.15, 2.5.x ≤ 2.5.8), upgrade to Rancher 2.5.9+ or 2.4.16+ following the official upgrade documentation (requires Helm chart upgrade or rancher/rancher container image update).
  3. After upgrade, verify the RBAC validation logic by attempting to create a RoleBinding without specifying the API group; the request should be rejected.
  4. Re-run an RBAC audit to ensure no unauthorized bindings were introduced during the exploitation window.

Long-Term Hardening:

  • Implement GitOps-based RBAC management where all RoleBindings are applied via CI/CD pipelines with peer review, preventing ad-hoc RBAC changes via Rancher UI/API.
  • Use Open Policy Agent (OPA) / Gatekeeper constraints to enforce that only approved roles can be bound to subjects.
  • Enable Kubernetes RBAC audit logging to a central SIEM for continuous monitoring.
  • Segregate Rancher management plane from workload clusters with strict network segmentation.
  • Subscribe to SUSE/Rancher security advisories and CVE feeds for future patch confirmations.

References

  1. NVD Entry: https://nvd.nist.gov/vuln/detail/CVE-2021-25318
  2. CVE.org Record: https://cve.org/CVERecord?id=CVE-2021-25318
  3. Rancher Security Advisories (official vendor page — check for CVE-2021-25318): https://www.suse.com/security/cve/
  4. Rancher GitHub Releases (for 2.5.9 / 2.4.16 patch verification): https://github.com/rancher/rancher/releases
  5. MITRE ATT&CK Technique T1222 — File and Directory Permissions Modification: https://attack.mitre.org/techniques/T1222/

Known Campaigns / In-the-Wild Evidence: No known threat actor campaigns or exploit-in-the-wild evidence has been reported for CVE-2021-25318 as of the publication date of this report. EPSS score (0.01051, 61.1st percentile) indicates low general exploitation probability, and the CVE is not present on the CISA Known Exploited Vulnerabilities (KEV) catalog.

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

product:"Rancher"
title:"Rancher" "Kubernetes Management"
http.title:"Rancher"
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2021-25318/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.