Skip to content
Info disclosure Write-up Advanced

Information leakage vulnerability in Google Cloud Shell’s proxy service

The Cloud Shell proxy service forwarded a non-expiring session cookie to the user's virtual machine, where a malicious custom image could capture it. An attacker could then use the cookie to access the user's Cloud Shell editor and execute commands once the user switched back to the trusted default environment.

Psi Follow

Published on ψ.fun

Google Cloud Shell is a product of the Google Cloud Platform (GCP) that provides a number of interesting features, such as an interactive shell environment and an integrated code editor, with the intent of making experimenting and administration of GCP products easier while requiring very little setup. A particularly…

Psi, on ψ.fun

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 proxy service forwarded the authentication cookie to the virtual machine instead of stripping it before forwarding.

Impact

An attacker could access the user's Cloud Shell editor and execute commands, potentially gaining access to the user's GCP resources, but only if the user loaded the malicious image and later switched back to the trusted environment.

What the attacker needed

Attacker publishes a custom Docker image; victim loads the image as untrusted; victim later switches to trusted environment

The fix

The vulnerability was fixed by having the proxy service strip the relevant cookie from requests before forwarding them to the virtual machine.

How it was found

  1. The attacker creates and publishes a custom Docker image that extracts cookies from incoming requests and sends them to the attacker.
  2. A Cloud Shell user loads the image as an untrusted environment, and the malicious code executes.
  3. The attacker uses the captured cookie and domain to connect to the user's Cloud Shell endpoint.
  4. The attacker checks if the user has switched back to the trusted default environment and gains access to the editor.

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.

When you use Google Cloud Shell, a special cookie proves who you are. The proxy service that sends your requests to your virtual machine was also sending this cookie along. If you loaded a custom image from someone else, that image could read the cookie and later use it to access your Cloud Shell editor, even after you switched back to the normal image. The editor lets you run commands, so the attacker could control your environment.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Psi

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.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.