Skip to content
Misconfiguration Write-up Advanced

Exploiting Insecure GKE (Google Kubernetes Engine) Defaults

A compromised pod in a GKE cluster could reach an exposed Docker daemon on port 2375, leading to code execution in a privileged Jenkins pod and escape to the underlying node. From there, the attacker accessed GCP service account credentials and escalated privileges within the cluster to eventually control all nodes and read all cloud storage buckets.

assured.se

Published on assured.se

We recently did an assessment where the customer in recent years had containerized their web application and moved it into a Kubernetes cluster in GCP (Google Cloud Platform). At the end of the test we theorized that it would be possible to control large parts of the cloud environment.

The author, on assured.se

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 combination of missing network policies, a Docker daemon bound to all interfaces, a privileged container, and overly permissive service accounts allowed the attack chain.

What the attacker needed

Code execution on a pod; no network policies; Docker daemon exposed on port 2375; privileged container

The fix

The report recommends implementing strict network policies, limiting metadata API access, avoiding privileged containers, binding services to localhost, applying least privilege, and using pod affinity and taints.

How it was found

  1. Gain code execution on a pod in the cluster.
  2. Scan the internal network and find port 2375 open on the Jenkins pod.
  3. Use the Docker API on port 2375 to run a container and move laterally to the Jenkins pod.
  4. Escape the privileged docker-in-docker container to the node using core dumps and access to /dev/sda1.
  5. Access the GCP metadata API from the node to obtain service account credentials.
  6. Use the node's credentials to access Kubernetes secrets and escalate privileges within the cluster.

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.

This report shows how a small weakness in one part of a cloud system can be chained with others to take over much more. An attacker who already had a foothold in one container could talk to an unprotected Docker service, break out to the underlying server, and then steal cloud credentials. The lesson is that default settings and loose network rules can turn a minor bug into a major breach.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.