An attacker with access to a Kubernetes cluster could chain two vulnerabilities in Google Kubernetes Engine (GKE) to escalate privileges and take over the cluster, cybersecurity firm Palo Alto Networks reports.
The issues, which may not pose a significant risk on their own, were identified in FluentBit, the default logging agent in GKE, and in Anthos Service Mesh (ASM), an optional add-on for controlling service-to-service communication within the environment.
A lightweight log processor and forwarder, FluentBit has been the default logging agent in GKE since March 2023, being deployed as a DaemonSet (controller) from the get-go. ASM is Google’s implementation of the Istio Service Mesh open source project, used for the management and visualization of services.
The recently identified vulnerabilities in FluentBit and ASM, Palo Alto Networks says, can be exploited as part of the second-stage of an attack, provided that the attacker has achieved remote code execution in the FluentBit container or that they can break out of another container.
“If an attacker has the ability to execute in the FluentBit container and the cluster has ASM installed, they can create a single powerful chain to gain complete control of a Kubernetes cluster. Attackers can use this access to conduct data theft, deploy malicious pods and disrupt the cluster’s operations,” Palo Alto Networks explains.
A misconfiguration in FluentBit could allow an attacker to use the token of any pod in the node to impersonate the pod, gain unauthorized access to the cluster, and list all running pods.
“Besides gaining unauthorized access to the cluster, an attacker can escalate their privilege or perform harmful actions. In fact, this gives the attacker a huge attack surface, depending on the permissions of the neighboring pods in the node,” Palo Alto Networks says.
Furthermore, the cybersecurity firm discovered that, post installation, the ASM’s Container Network Interface (CNI) DaemonSet retains excessive permissions, allowing an attacker to create a new pod with these permissions and gain privileged access to the cluster.
By exploiting the FluentBit issue, an attacker can map the cluster to find the Istio container, and abuse ASM CNI DaemonSet’s excessive permissions to create a ‘powerful’ pod, target a service account with high privileges, and obtain permissions to act as a cluster administrator.
On December 14, Google announced patches for both issues, urging users to manually update their clusters and node pools. GKE versions 1.25.16-gke.1020000, 1.26.10-gke.1235000, 1.27.7-gke.1293000, and 1.28.4-gke.1083000, and ASM versions 1.17.8-asm.8, 1.18.6-asm.2, and 1.19.5-asm.4 resolve the bugs.
“These vulnerabilities are not exploitable on their own in GKE and require an initial compromise. We are not aware of any instances of exploitation of these vulnerabilities,” Google notes in its advisory.