Skip to content

Lesson 11 of 14 · 15m

Kubernetes Adds an Orchestrator With Credentials

Pods carry API tokens, nodes hold kubelet identity, and Siloscape, the subPath race, NVIDIA toolkit bugs, and cloud metadata each turn pod access into node access.

The pod is a container plus credentials

Kubernetes doesn't add a new isolation layer to containers — every Linux mechanism in this course is still the wall. What it adds is an orchestrator, and the orchestrator's credentials now live inside the thing you're isolating. Escaping a pod is container escape plus the pod's API permissions plus whatever the node itself can do. The blast radius grew.

The free credential is mounted by default: /var/run/secrets/kubernetes.io/serviceaccount/token, a JWT authenticating to the API server as the pod's ServiceAccount. automountServiceAccountToken defaults to true, and an astonishing number of pods never call the API at all — they carry a credential for no reason. An escaped pod, or just RCE inside one, hands over whatever RBAC that SA holds: read secrets in the namespace, exec into other pods, more if someone's cluster-admin binding went wide.

Then there are the node-level surfaces:

The kubelet API on 10250. The node's agent exposes an HTTPS endpoint that can exec into pods and stream logs. Properly configured it demands client certs; deployed carelessly — anonymous-auth left enabled, a leaked kubelet cert, the ancient read-only port 10255 — it's remote code execution on the node. hostPath mounts onto /var/lib/kubelet/pki steal the node's client identity, and node identity in Kubernetes is powerful in ways people underestimate.

Siloscape, June 2021. Daniel Prizmant at Unit 42 published the first Windows container escape against Kubernetes — the "silo" mechanism Windows containers used was softer than Linux namespaces, and escaping to the node was step one. Step two is the part to remember: on some managed clusters, the node's kubelet credentials could create CertificateSigningRequests that minted certificates for identities the node shouldn't have held — privilege escalation to cluster admin through the certificate API. The escape didn't end at the node; the node's credentials were the second vulnerability.

CVE-2021-25741, December 2021. A symlink-exchange race in subPath handling: the kubelet resolved a pod's volume subpath, and racing the resolution with a symlink swap could redirect the mount to the host's root filesystem. Bishop Fox researchers showed the pod spec itself was the weapon — no container compromise required first; the mount came pre-escaped.

CVE-2024-0132 and friends, September-October 2024. NVIDIA Container Toolkit — the shim that injects GPU devices and driver libraries into containers on every AI node — mishandled mount spec resolution. A crafted container image could pull host paths into a GPU pod's mount namespace; CVSS 9.0, fixed in toolkit 1.16.2. The attack surface wasn't Kubernetes or Linux namespaces at all; it was the vendor plumbing that drills holes for accelerators.

Cloud metadata. Pods reach the instance metadata service at 169.254.169.254 like any process on the node. IMDSv1 hands an unauthenticated HTTP request the node's IAM credentials — a pod compromise or even an SSRF inside a pod becomes cloud-account compromise. AWS's IMDSv2 requires a token and a hop limit; setting the hop limit to 1 stops pod-originated requests from ever completing the handshake.

The pattern

Notice the through-line: almost nothing in this lesson is a namespace flaw. It's orchestrator credentials mounted in pods, node agents that assume localhost is private, a mount race in the kubelet, vendor toolkit plumbing, and a metadata endpoint. Kubernetes concentrates privilege on nodes — kubelet certs, CSI mounts, toolkit mounts — and hands parts of it to pods by default.

What to actually do

  • automountServiceAccountToken: false on every pod that doesn't call the API; per-SA least privilege for the ones that do.
  • Grep manifests for hostPath, hostPID, hostNetwork, hostIPC, privileged, mountPropagation: Bidirectional.
  • Keep kubelet authn on and rotate leaked node certs; treat hostPath onto kubelet dirs as a breach in progress.
  • Enforce IMDSv2 with hop limit 1 on cloud nodes, and block 169.254.169.254 egress with NetworkPolicy where you can.
  • Keep toolkit and kubelet versions patched — these are the node-side equivalent of runc.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.