Skip to content
Misconfiguration Write-up Advanced

4 Google Cloud Shell bugs explained

The Google Cloud Shell container exposed the host's Docker socket, allowing an attacker with access to the container to escape and gain root on the host. From there, the attacker could reconfigure Kubernetes to run containers in privileged mode for debugging.

Wouter ter Maat Follow

Published on offensi.com

In 2019 i spent a significant amount of my time hunting for bugs in the Google Cloud Platform. While the Google Cloud Platform is known to be a tough target among bughunters, i was lucky enough to have some modest success in finding bugs in one of it’s services, the Google Cloud Shell.

Wouter ter Maat, on offensi.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

The Cloud Shell container was given access to the host's Docker Unix socket, which grants full control over the host when reachable from inside the container.

Impact

An attacker who compromises a Cloud Shell instance could escape the container, gain root on the host, and access the user's GCP resources because the gcloud client is already authenticated.

What the attacker needed

Access to a Cloud Shell instance

How it was found

  1. Inspect running processes and /proc to confirm the environment is a container.
  2. Find two Docker Unix sockets, including one at /google/host/var/run/docker.sock.
  3. Use the host Docker socket to start a privileged container with the host filesystem mounted.
  4. Access the host as root through that container.
  5. Reconfigure the Kubernetes pod manifest to run containers in privileged mode for debugging.

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.

Google Cloud Shell gives you a Linux terminal in your browser. The terminal runs inside a container, a lightweight isolated environment. The mistake was that the container could talk to the host's Docker service, which controls all containers. That let the author break out of the container and take full control of the underlying machine.

What is Misconfiguration?

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

More from Google

View all

The newest disclosed reports for this program.

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.