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.
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…
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
- The attacker creates and publishes a custom Docker image that extracts cookies from incoming requests and sends them to the attacker.
- A Cloud Shell user loads the image as an untrusted environment, and the malicious code executes.
- The attacker uses the captured cookie and domain to connect to the user's Cloud Shell endpoint.
- 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.