Kubernetes Grey Zone: Risks in Managed Cluster Middleware
Managed cluster middleware components in AKS, EKS, and GKE often run with high privileges and host access, and some can be abused for privilege escalation. An attacker with write access to Node Problem Detector's custom plugin directory or Fluent Bit's ConfigMap can achieve periodic code execution as root on cluster nodes.
Published on wiz.io
Managed clusters have become a go-to way to deploy and operate production Kubernetes workloads. This is partially due to the built-in services and features cloud service providers (CSPs) pack into their Kubernetes offerings.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the middleware components are configured with high privileges and host access, and their configuration files (like NPD plugin scripts or Fluent Bit ConfigMaps) are writable by users who should not have such access.
Impact
An attacker could escalate privileges to root on cluster nodes, persist, evade defenses, and move laterally to other pods and nodes.
What the attacker needed
Write access to NPD plugin directory or Fluent Bit ConfigMap; managed Kubernetes cluster (AKS, EKS, or GKE)
The fix
Cloud providers should run host-level middleware as DaemonSets or CronJobs with controlled affinity, and cluster operators should avoid running containers as root and apply namespace granularity where possible.
How it was found
- Identify a target cluster with Node Problem Detector or Fluent Bit installed.
- Obtain write access to the NPD custom plugin directory or the Fluent Bit ConfigMap.
- Place a malicious script or configuration that executes commands periodically.
- The middleware executes the code with high privileges, allowing the attacker to access tokens and move laterally.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Managed Kubernetes clusters include extra software called middleware that helps run the cluster. This software often has high privileges and can be tricked into running malicious code if an attacker can change its configuration, leading to full control of the node.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.