Skip to content
Access control Write-up Advanced

Executive Summary

Unit 42 researchers found that GKE Autopilot's policy could be bypassed by masquerading as allowlisted workloads, allowing a user who can create a pod to escape the container and compromise the node. From there, attackers could escalate to full cluster administrator and install invisible backdoors via mutating admission webhooks.

Unit 42 Follow

Published on unit42.paloaltonetworks.com

In February 2021, Google announced Autopilot, a new mode of operation in Google Kubernetes Engine (GKE). With Autopilot, Google provides a "hands-off" Kubernetes experience, managing cluster infrastructure for the customer.

Yuval Avrahami, on unit42.paloaltonetworks.com

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 allowlisted workload verification only checked the container's command and image name, not the actual code or image digest, so an attacker could run arbitrary code while appearing to be an allowlisted Datadog agent and access host paths.

Impact

An attacker with pod creation rights could escape the container, compromise the node, escalate to full cluster administrator, and install invisible backdoors to exfiltrate secrets, deploy malware, or disrupt workloads; Google fixed the issues and all Autopilot clusters are now protected.

What the attacker needed

Ability to create a pod in the cluster; Initial foothold (e.g., compromised developer account)

The fix

Google deployed numerous fixes, including hardening allowlisted workload verification, allowing administrators to list and create mutating admission webhooks, moving policy enforcement to a new controller, and removing service account exemptions.

How it was found

  1. Create a pod that specifies the command and image of an allowlisted Datadog agent, but runs attacker-controlled code.
  2. Use the mounted host paths to access the containerd socket and create a privileged container that mounts the host filesystem.
  3. From that privileged container, install a systemd service that spawns a reverse shell from the node to an attacker-controlled machine.
  4. Harvest the service account token of a powerful kube-system pod (e.g., metrics-server) from the compromised node.
  5. Use that token to update an existing deployment's service account to a more powerful one (e.g., clusterrole-aggregation-controller) and add a malicious container to retrieve the new token.
  6. Use the powerful token to create a mutating admission webhook that is invisible to Autopilot administrators, establishing persistent backdoor access.

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.

Kubernetes is a system for running containers (lightweight, isolated applications). GKE Autopilot is a managed version where Google runs the underlying servers (nodes) for you. The researchers found that Autopilot's security checks could be tricked: a user who could start a container could pretend it was a trusted monitoring agent, break out of the container, take over the node, and then gain full control of the whole cluster without the administrator noticing.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Unit 42

View all

3 more disclosed reports, best first.

More from Google

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.