Skip to content
Account takeover Write-up Advanced

Google Cloud Platform (GCP) Vertex AI Workbench Cross-Tenant Full Account Takeover with Managed End User Credentials

A startup script in Vertex AI Workbench could be abused to send a victim's managed end user credentials to an attacker-controlled server. An attacker could create a Workbench instance with the victim as single user, set a malicious metadata URL, and after the victim clicks 'Open JupyterLab', trigger an upgrade to exfiltrate the victim's access token.

Moshe Bernstein Follow

Published on tenable.com

Tenable Research has identified and responsibly disclosed a critical vulnerability in Google Vertex AI Workbench. This flaw enabled a cross-tenant Full Account Takeover by exfiltrating the managed End User Credentials (EUC) of any GCP user with minimal interaction.

Moshe Bernstein, on tenable.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

Vertex AI Workbench is Google Cloud Platform's managed notebook service. Among its deployment options is Single User Mode with managed End User Credentials (EUC). In this mode a notebook instance runs with the actual identity of one specified GCP user: the user's credentials are injected into the instance metadata (IMDS) so that the notebook acts as that user. Because the whole point is to place live user credentials inside the instance, Google hardens these instances: SSH access is blocked, and custom containers and custom startup scripts are not permitted.

The credentials only appear in the instance metadata after the user clicks Open JupyterLab in the Google Cloud Console. That click triggers a CheckAuthorization request which applies the user's OAuth token to the instance, provided the user has authorised Vertex AI Workbench OAuth.

The feature that made the takeover possible is a built-in startup script called runtime-config-post-result, part of the "Click to Deploy" (c2d) suite used to initialise these instances. The script reports the instance startup result by sending an authenticated status update request to the URL held in the instance metadata under the status-config-url attribute. The authentication on that request is based on the identity associated with the instance, which in Single User Mode with EUC is the victim's identity.

Tenable Research reported the issue to Google, which assigned it S1 severity and later a CVE ID. The advisory rates it High.

Setup

The attacker needs:

  1. A GCP project of their own (the attacker's tenant).
  2. An HTTP server they control, to receive the exfiltrated request.
  3. The ability to grant the victim's principal IAM permissions inside the attacker's project.
  4. A victim who will click Open JupyterLab for the shared instance, and who has authorised Vertex AI Workbench OAuth so that their token can be applied to the instance.

No SSH access, custom container or custom script is needed, and none of those are available on EUC instances anyway. The attack uses only the console, the instance metadata and the built-in startup script.

Finding it

The runtime-config-post-result startup script sends a status update to whatever URL is configured in the status-config-url metadata attribute. The script sends a status update to whatever URL is configured in the status-config-url metadata attribute, and it signs that request with the identity associated with the instance. On an EUC instance, that identity is the single user, i.e. the victim. The metadata attribute is attacker-controlled at instance creation time, so the destination of an authenticated request containing the victim's credentials is attacker-controlled too.

The obstacle is timing. runtime-config-post-result normally runs only on first boot, which happens before the victim has clicked Open JupyterLab and before any credentials have been loaded into IMDS. At that point the request goes out with no usable credentials. The researcher found that upgrading the Workbench instance forces the startup scripts to re-run while the existing IMDS state is preserved. So if the victim has already clicked the button, the re-run script picks up the victim's credentials from IMDS and sends them to the attacker's server.

Exploitation

All of the following happens in the attacker's project.

Step 1: Grant the victim IAM permissions

Give the victim's principal IAM permissions in the attacker's tenant.

Step 2: Start creating a Workbench instance

Go to https://console.cloud.google.com/vertex-ai/workbench/instances and create a new Workbench instance.

Step 3: Open Advanced Options

Click on Advanced Options.

Step 4: Choose an older JupyterLab version

Under Environment, choose JupyterLab 4.x and Use a previous version, and select an older version.

Step 5: Point status-config-url at the attacker's server

Click + Add metadata and add the following attribute:

Text
status-config-url

with the value of the attacker's HTTP server. This is the URL that runtime-config-post-result will call, authenticated as the instance identity.

Step 6: Set the victim as single user with EUC

Under IAM and security, choose Single user, enter the victim's email, and check Enable managed end user credentials.

Step 7: Create the instance

Create the instance and wait for it to finish provisioning. This may take a few minutes.

Step 8: Observe the first-boot request

Once the machine is up, the attacker's server receives an HTTP request whose Authorization header contains No credentialed accounts.

Step 9: Get the victim to click Open JupyterLab

Share either the instance page with the victim and have them click Open JupyterLab, or share the JupyterLab URL directly and wait for the pop-up that instructs them to click it. The click triggers the CheckAuthorization request that applies the victim's OAuth token to the instance metadata.

Step 10: Upgrade the instance

Once the victim has clicked the button, click Upgrade to upgrade the machine, and wait for the victim to close the tab and for the upgrade to complete. This also may take a few minutes. The upgrade re-runs the startup scripts while keeping the existing IMDS state, so runtime-config-post-result executes again, this time with the victim's credentials available.

Step 11: Collect the token

The victim's access token is exfiltrated to the attacker's server.

Root cause

The design flaw is that a startup script which makes an authenticated request to a URL taken from instance metadata is present on instances whose identity is a real user's managed credentials. The metadata key status-config-url is settable by whoever creates the instance, so the destination of the authenticated request is under attacker control, and the authentication is the instance identity, which in Single User Mode with EUC is the victim.

The existing defences did not stop it. EUC instances block SSH, custom containers and custom scripts, but runtime-config-post-result is a built-in part of the c2d suite, not a custom script, so it runs regardless. The first-boot-only behaviour looks like a natural limit, but the upgrade path re-runs the scripts while preserving IMDS, which defeats it. The victim's credentials only need to be in IMDS at the moment the script re-runs, and the attacker controls when the upgrade happens.

Impact

A cross-tenant Full Account Takeover. An attacker in their own project can exfiltrate the managed End User Credentials of any GCP user, from any tenant, who is named as the single user of the attacker's instance and who clicks Open JupyterLab.

The interaction required from the victim is minimal: one click on the button, or following a shared JupyterLab URL and clicking through the pop-up. The victim must have authorised Vertex AI Workbench OAuth for the token to be applied. The attacker must be able to grant the victim's principal IAM permissions in their own project, and must wait for provisioning and for the upgrade to complete.

Fix

Google's fix prevents the status-config-url and status-variable-path keys from being set in the control plane, and removes the vulnerable startup script from new Workbench images. The fix prevents the status-config-url and status-variable-path keys from being set in the control plane and also removes the vulnerable start-up script from new Workbench images.

Variants to test

  1. Other metadata-driven callback scripts. Look for startup or init scripts on managed services that read a URL from instance metadata and send an authenticated request to it. A positive result is a request arriving at your server from the instance, with an Authorization header reflecting the instance identity.
  2. Other re-run paths. Besides upgrade, look for any operation that re-executes startup scripts while preserving IMDS (restart, reimage, configuration change). A positive result is the callback firing again after credentials have been loaded, carrying a usable token.
  3. Other managed-identity modes. Test services that inject a user's credentials into instance metadata for a single named user. A positive result is any built-in component that can be induced to send those credentials to an attacker-chosen destination.
  4. Related metadata keys. The fix names status-config-url and status-variable-path; probe for sibling keys in the same c2d configuration family that influence where or what the script reports. A positive result is a key that is still accepted and changes the destination or contents of the authenticated request.
  5. Older images. The fix removes the script from new images, so test instances built from older images. A positive result is the vulnerable script still present and still calling the configured URL.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

What happened, in plain words

Google Cloud Platform (GCP) is Google's collection of rented computing services: storage, databases, virtual machines, and so on. One of those services is Vertex AI Workbench, a managed notebook service. A notebook here means a web page where you can write and run code, a bit like a shared online document, except the document can run programs. "Managed" means Google looks after the machine for you.

Workbench has a mode called Single User Mode with managed End User Credentials (EUC). In that mode a notebook machine runs as one specific GCP user, using that person's real credentials. Credentials here means the digital proof of who you are, like the key to your flat: whoever holds it is treated as you. To make the notebook act as that user, Google places the user's credentials inside the machine's instance metadata. Instance metadata (often shortened to IMDS) is a small internal information board that a cloud machine can read about itself: its name, its settings, and in this case the user's credentials. The comparison is a staff noticeboard inside an office: anyone working in the building can walk up and read it, which is fine as long as only trusted people are inside.

Because live user credentials sit on that noticeboard, Google hardens these instances. Hardened means extra locks are fitted. SSH access is blocked (SSH is the usual way a technical person opens a remote terminal on a machine), and custom containers and custom startup scripts are not allowed. A container is a packaged bundle of software; a startup script is a small program that runs automatically when a machine boots.

The credentials only appear in the instance metadata after the user clicks Open JupyterLab in the Google Cloud Console. The Console is the website where you manage your GCP resources. JupyterLab is the notebook interface itself. That click triggers a CheckAuthorization request. A request is one message a browser or program sends to a server asking it to do something; an API is simply the agreed set of such requests a service offers, like a restaurant menu: you can only order what is listed. CheckAuthorization applies the user's OAuth token to the instance, provided the user has authorised Vertex AI Workbench OAuth. An OAuth token is a temporary pass issued after you log in and approve an app, similar to a cloakroom ticket: it proves you were allowed in, without carrying your password around.

The feature that made the takeover possible is a built-in startup script called runtime-config-post-result, part of the "Click to Deploy" (c2d) suite used to initialise these instances. Initialise means set up on first start. The script reports the instance startup result by sending an authenticated status update request to the URL held in the instance metadata under the status-config-url attribute. A URL is a web address. An attribute here is just a named setting, a label with a value attached. Authenticated means the request carries proof of identity. The authentication on that request is based on the identity associated with the instance, which in Single User Mode with EUC is the victim's identity.

Tenable Research reported the issue to Google, which assigned it S1 severity and later a CVE ID. Severity is a rating of how serious a bug is; S1 is Google's label for its most serious category. A CVE ID is a public catalogue number given to a known security flaw so people can refer to it unambiguously. The advisory rates it High.

Setup

The attacker needs:

  1. A GCP project of their own (the attacker's tenant). A project is a container for resources inside a Google account; a tenant is the organisation or account boundary around it. Cross-tenant means crossing from one account boundary into another, which should never be possible.
  2. An HTTP server they control, to receive the exfiltrated request. A server is a computer that answers requests; HTTP is the language browsers and servers use to talk. Exfiltrated means stolen and sent out.
  3. The ability to grant the victim's principal IAM permissions inside the attacker's project. A principal is an identity, usually a person's account. IAM (Identity and Access Management) is the permission system: it decides who may do what. Granting permissions is like adding someone's name to the guest list for your own building.
  4. A victim who will click Open JupyterLab for the shared instance, and who has authorised Vertex AI Workbench OAuth so that their token can be applied to the instance.

No SSH access, custom container or custom script is needed, and none of those are available on EUC instances anyway. The attack uses only the console, the instance metadata and the built-in startup script.

Finding it

The runtime-config-post-result startup script sends a status update to whatever URL is configured in the status-config-url metadata attribute. The script sends a status update to whatever URL is configured in the status-config-url metadata attribute, and it signs that request with the identity associated with the instance. On an EUC instance, that identity is the single user, i.e. the victim. The metadata attribute is attacker-controlled at instance creation time, so the destination of an authenticated request containing the victim's credentials is attacker-controlled too. In everyday terms: the machine is told "when you finish starting, phone this number and say who you are", and the attacker gets to write the number down.

The obstacle is timing. runtime-config-post-result normally runs only on first boot, which happens before the victim has clicked Open JupyterLab and before any credentials have been loaded into IMDS. At that point the request goes out with no usable credentials. The researcher found that upgrading the Workbench instance forces the startup scripts to re-run while the existing IMDS state is preserved. So if the victim has already clicked the button, the re-run script picks up the victim's credentials from IMDS and sends them to the attacker's server. Think of a courier who visits once when the office opens, before the safe key has been put on the noticeboard. If you can make the courier come back later, the key is there to be read.

Exploitation

All of the following happens in the attacker's project.

Step 1: Grant the victim IAM permissions

Give the victim's principal IAM permissions in the attacker's tenant.

Step 2: Start creating a Workbench instance

Go to https://console.cloud.google.com/vertex-ai/workbench/instances and create a new Workbench instance.

Text
https://console.cloud.google.com/vertex-ai/workbench/instances

This is the address of the Workbench instances page in the Google Cloud Console. Opening it in a browser shows the list of notebook machines in the project and a button to create a new one. The attacker starts here because the whole attack is built out of ordinary console actions.

Step 3: Open Advanced Options

Click on Advanced Options. Click on Advanced Options.

Step 4: Choose an older JupyterLab version

Under Environment, choose JupyterLab 4.x and Use a previous version, and select an older version. An image is the pre-built disk contents a new machine starts from, like a template.

Step 5: Point status-config-url at the attacker's server

Click + Add metadata and add the following attribute:

Text
status-config-url

with the value of the attacker's HTTP server. This is the URL that runtime-config-post-result will call, authenticated as the instance identity.

Text
status-config-url

This line is the name of the metadata setting being added. The value the attacker types next to it is their own server's address. The setting is a label on the noticeboard that says "report startup results here". By writing their own address into it, the attacker decides where the machine will send its authenticated report.

Step 6: Set the victim as single user with EUC

Under IAM and security, choose Single user, enter the victim's email, and check Enable managed end user credentials. This tells Google that the machine should run as that one person and that the person's managed credentials should be placed on the instance. It is the setting that turns an ordinary notebook into one holding live user credentials.

Step 7: Create the instance

Create the instance and wait for it to finish provisioning. This may take a few minutes. Provisioning means Google is building and starting the machine in the background.

Step 8: Observe the first-boot request

Once the machine is up, the attacker's server receives an HTTP request whose Authorization header contains No credentialed accounts. A header is a labelled line inside a request carrying extra information, like the address block on an envelope; Authorization is the header that normally carries proof of identity. In other words, the attacker has proved the phone number works, even though the caller had nothing to say yet.

Step 9: Get the victim to click Open JupyterLab

Share either the instance page with the victim and have them click Open JupyterLab, or share the JupyterLab URL directly and wait for the pop-up that instructs them to click it. The click triggers the CheckAuthorization request that applies the victim's OAuth token to the instance metadata. This is the step that puts the key on the noticeboard. The victim sees a normal Google page and a normal button, which is why the interaction required is so small.

Step 10: Upgrade the instance

Once the victim has clicked the button, click Upgrade to upgrade the machine, and wait for the victim to close the tab and for the upgrade to complete. This also may take a few minutes. The upgrade re-runs the startup scripts while keeping the existing IMDS state, so runtime-config-post-result executes again, this time with the victim's credentials available.

Step 11: Collect the token

The victim's access token is exfiltrated to the attacker's server. An access token is the short-lived pass that proves identity to Google's services.

Root cause

The design flaw is that a startup script which makes an authenticated request to a URL taken from instance metadata is present on instances whose identity is a real user's managed credentials. The metadata key status-config-url is settable by whoever creates the instance, so the destination of the authenticated request is under attacker control, and the authentication is the instance identity, which in Single User Mode with EUC is the victim.

The existing defences did not stop it. EUC instances block SSH, custom containers and custom scripts, but runtime-config-post-result is a built-in part of the c2d suite, not a custom script, so it runs regardless. The first-boot-only behaviour looks like a natural limit, but the upgrade path re-runs the scripts while preserving IMDS, which defeats it. The victim's credentials only need to be in IMDS at the moment the script re-runs, and the attacker controls when the upgrade happens.

Impact

A cross-tenant Full Account Takeover. An attacker in their own project can exfiltrate the managed End User Credentials of any GCP user, from any tenant, who is named as the single user of the attacker's instance and who clicks Open JupyterLab. The victim's access token ends up on the attacker's server, giving the attacker the victim's identity.

The interaction required from the victim is minimal: one click on the button, or following a shared JupyterLab URL and clicking through the pop-up. The victim must have authorised Vertex AI Workbench OAuth for the token to be applied. The attacker must be able to grant the victim's principal IAM permissions in their own project, and must wait for provisioning and for the upgrade to complete.

Fix

Google's fix prevents the status-config-url and status-variable-path keys from being set in the control plane, and removes the vulnerable startup script from new Workbench images. The control plane is the management layer that accepts your settings and builds the machine, as opposed to the machine itself. Both halves matter: blocking the metadata keys removes the attacker-controlled destination, and removing the script removes the mechanism that sends the authenticated request.

Variants to test

  1. Other metadata-driven callback scripts. Look for startup or init scripts on managed services that read a URL from instance metadata and send an authenticated request to it. A positive result is a request arriving at your server from the instance, with an Authorization header reflecting the instance identity.
  2. Other re-run paths. Besides upgrade, look for any operation that re-executes startup scripts while preserving IMDS (restart, reimage, configuration change). A positive result is the callback firing again after credentials have been loaded, carrying a usable token.
  3. Other managed-identity modes. Test services that inject a user's credentials into instance metadata for a single named user. A positive result is any built-in component that can be induced to send those credentials to an attacker-chosen destination.
  4. Related metadata keys. The fix names status-config-url and status-variable-path; probe for sibling keys in the same c2d configuration family that influence where or what the script reports. A positive result is a key that is still accepted and changes the destination or contents of the authenticated request.
  5. Older images. The fix removes the script from new images, so test instances built from older images. A positive result is the vulnerable script still present and still calling the configured URL.

Glossary

  • API: the agreed set of requests a service accepts, like a menu you can order from.
  • Access token: a temporary pass proving who you are to a service, without exposing your password.
  • Attribute (metadata): a named setting with a value, stored on the instance's internal information board.
  • Authentication: proof of identity attached to a request.
  • Authorization header: the part of an HTTP request that normally carries that proof.
  • CVE ID: a public catalogue number for a known security flaw.
  • CheckAuthorization: the request the console sends when a user clicks Open JupyterLab, which applies the user's OAuth token to the instance.
  • Click to Deploy (c2d): the suite of built-in scripts Google uses to initialise these instances.
  • Container: a packaged bundle of software that runs in isolation.
  • Control plane: the management layer that accepts settings and builds machines, as opposed to the machines themselves.
  • Credentials: the digital proof of identity, such as a token or key.
  • Cross-tenant: crossing from one account or organisation boundary into another.
  • End User Credentials (EUC): the managed credentials of a real user, injected into an instance so it acts as that user.
  • Exfiltration: stealing data and sending it out to a place the attacker controls.
  • Full Account Takeover: complete control of another person's account, not just access to one page.
  • GCP: Google Cloud Platform, Google's collection of rented computing services.
  • Header: a labelled line inside an HTTP request carrying extra information.
  • HTTP: the language browsers and servers use to exchange requests and responses.
  • IAM: Identity and Access Management, the system that decides who may do what.
  • Image: the pre-built disk contents a new machine starts from.
  • IMDS (instance metadata): an internal information board a cloud machine can read about itself, including settings and sometimes credentials.
  • Initialise: set up on first start.
  • JupyterLab: the notebook interface where code is written and run in the browser.
  • Metadata key: the name part of a metadata setting.
  • Notebook: a web page where you can write and run code.
  • OAuth: a way to approve an app without giving it your password, issuing a temporary token instead.
  • Principal: an identity, usually a person's account.
  • Project: a container for resources inside a Google account.
  • Provisioning: building and starting a machine in the background.
  • Request: one message sent to a server asking it to do something.
  • runtime-config-post-result: the built-in startup script that reports startup results to the URL in status-config-url, authenticated as the instance identity.
  • S1: Google's label for its most serious severity category.
  • Severity: a rating of how serious a bug is.
  • Single User Mode: a Workbench mode where the instance runs as one specified user.
  • SSH: the usual way to open a remote terminal on a machine.
  • Startup script: a small program that runs automatically when a machine boots.
  • status-config-url: the metadata attribute holding the URL the startup script reports to.
  • status-variable-path: a related metadata key named in the fix.
  • Tenant: the organisation or account boundary around a set of resources.
  • Token: a temporary pass proving identity.
  • URL: a web address.
  • Vertex AI Workbench: Google Cloud Platform's managed notebook service.
  • Vulnerability: a flaw that lets someone make a system behave in a way its owner did not intend.

More by Moshe Bernstein

View all

4 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.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.