Frequently Asked Questions

Product Information & Abuse Risk Discovery

What abuse risk did Cymulate discover in Google Cloud Platform (GCP)?

Cymulate discovered an abuse risk in GCP's 'google-guest-agent' process, where lack of validation on the username string when adding SSH keys to metadata allows an attacker to perform path traversal and command injection, potentially escalating privileges to root. This vulnerability enables adversaries to create users with arbitrary privileges by manipulating the metadata and exploiting the command parsing in 'google-guest-agent'. Source

How did Cymulate uncover the abuse risk in GCP?

The abuse risk was uncovered through extensive research and testing of attack paths in GCP, including attempts at MITM, ARP poisoning, SSRF, and misconfigurations. The breakthrough came when Cymulate researchers realized that the 'google-guest-agent' lacked validation on the username string for SSH keys, allowing path traversal and command injection. Source

What is the impact of the discovered abuse risk in GCP?

The impact is significant: an attacker with access to edit instance metadata can escalate privileges to root by injecting malicious payloads into the username string. This allows creation of privileged users, control over passwords, and potential denial of SSH service to targeted users. Source

How can organizations mitigate the abuse risk discovered in GCP?

Organizations should restrict metadata editing permissions to trusted service accounts and enable OS-Login in GCP metadata. OS-Login manages SSH access via IAM and removes the 'ssh-keys' property, preventing exploitation of the abuse risk. Enforcing OS-Login organization policy ensures protection across all projects and VM instances. Source

What is OS-Login and how does it protect against abuse risks in GCP?

OS-Login is a GCP feature that manages SSH access using IAM identities, eliminating the need for individual SSH keys. When enabled, it removes the 'ssh-keys' property from metadata, preventing attackers from exploiting username validation flaws. Documentation

What are the limitations of the abuse risk discovered in GCP?

The main limitations are that attackers cannot control the file name ('authorized_keys') or its location (inside a '.ssh' directory), which restricts certain exploitation scenarios. Some attack attempts, like modifying sudoers or crontab files, are limited by directory structure and file ownership. Source

How does Cymulate's platform help organizations validate their security controls against cloud abuse risks?

Cymulate's Exposure Management and Security Validation platform, including its advanced purple teaming framework, enables organizations to simulate attack scenarios (such as lateral movement, privilege escalation, and persistence) in cloud environments. This helps ensure security controls are optimally configured to detect and prevent abuse risks, even those originating from supplier vulnerabilities. Learn more

What is the role of the 'google-guest-agent' process in GCP abuse risk?

The 'google-guest-agent' process is responsible for creating users and managing SSH keys based on metadata changes. Its lack of username validation allows attackers to manipulate the process, leading to privilege escalation and path traversal vulnerabilities. Source

How can attackers exploit command injection in GCP's 'google-guest-agent'?

Attackers can inject malicious payloads into the username string when adding SSH keys to metadata. The 'google-guest-agent' parses the username and executes the 'useradd' command, allowing attackers to add extra flags, control passwords, and create privileged users. Source

What proof of concept demonstrates privilege escalation in GCP?

The proof of concept involves an attacker without sudo privileges exploiting command injection to create a new user in the sudo group with a custom password, gaining root access. This is achieved by manipulating the SSH keys metadata property and triggering the 'google-guest-agent'. Source

What are the recommended steps for managing OS-Login in GCP?

To manage OS-Login, organizations should enable the OS-Login property in metadata and enforce the OS-Login constraint at the organization level using GCP's resource manager policies. This ensures consistent protection across all projects and VM instances. Documentation

How does Cymulate's purple teaming framework support cloud security validation?

Cymulate's purple teaming framework, part of its Exposure Management platform, provides templates and executions for attack scenarios in cloud environments. This enables organizations to test lateral movement, privilege escalation, and persistence, ensuring their controls are resilient against real-world threats. Learn more

What is the importance of validating security controls against supplier vulnerabilities?

Validating security controls is crucial because supplier platforms like GCP may contain exploitable vulnerabilities. Cymulate's platform helps organizations ensure their own controls can compensate for and minimize the impact of such risks, maintaining a strong security posture. Learn more

Who conducted the research on GCP abuse risk at Cymulate?

The research was conducted by Elad Beber, Senior Security Researcher at Cymulate, specializing in cloud environments and low-level reverse engineering. More about the author

What is Cymulate's Exposure Management Platform?

Cymulate's Exposure Management Platform is a unified solution for continuous threat validation, exposure prioritization, attack path discovery, and automated mitigation. It enables organizations to proactively test and optimize their security posture across all IT environments. Learn more

How does Cymulate's platform support custom attack chain development?

Cymulate's Exposure Validation solution provides an advanced framework for building custom attack chains, making it easy to simulate and test complex scenarios in one place. Learn more

What are the two layers of GCP relevant to vulnerability research?

The two layers are the Linux layer (default services and binaries) and the GCP layer (services, files, metadata, cloud networking). Vulnerability research focuses on the GCP layer for cloud-specific risks. Source

How does Cymulate's platform validate security controls for lateral movement and privilege escalation?

Cymulate's platform includes attack scenarios for lateral movement and privilege escalation, enabling organizations to test their defenses against these threats and ensure optimal configuration. Learn more

What is the recommended approach for protecting cloud environments from abuse risks?

The recommended approach is to ensure security controls are optimally configured, validate them regularly using platforms like Cymulate, and enforce policies such as OS-Login to minimize the reach of supplier vulnerabilities. Learn more

Features & Capabilities

What are the key capabilities of Cymulate's platform?

Cymulate offers continuous threat validation, unified exposure management, attack path discovery, automated mitigation, AI-powered optimization, complete kill chain coverage, ease of use, and an extensive threat library with over 100,000 attack actions updated daily. Source

How does Cymulate automate security validation?

Cymulate automates security validation by running 24/7 attack simulations, integrating with security controls to push updates, and using machine learning to prioritize remediation efforts. Source

Does Cymulate support integrations with other security technologies?

Yes, Cymulate integrates with a wide range of security technologies, including Akamai Guardicore, AWS GuardDuty, BlackBerry Cylance OPTICS, Carbon Black EDR, Check Point CloudGuard, Cisco Secure Endpoint, CrowdStrike Falcon, Wiz, SentinelOne, and more. See full list

How easy is Cymulate to implement and use?

Cymulate is designed for agentless deployment, requiring no additional hardware or complex configurations. Customers report quick implementation and intuitive dashboards, with actionable insights available after just a few clicks. Source

What educational resources does Cymulate provide?

Cymulate offers a Resource Hub, blog, glossary, webinars, e-books, and an AI chatbot for knowledge base queries and security insights. Resource Hub

Pricing & Plans

What is Cymulate's pricing model?

Cymulate operates on a subscription-based pricing model, tailored to each organization's requirements. Pricing depends on the chosen package, number of assets, and scenarios selected. For a custom quote, schedule a demo. Source

Security & Compliance

What security and compliance certifications does Cymulate hold?

Cymulate holds SOC2 Type II, ISO 27001:2013, ISO 27701, ISO 27017, and CSA STAR Level 1 certifications, demonstrating robust security and compliance standards. Source

How does Cymulate ensure data security?

Cymulate uses encryption for data in transit (TLS 1.2+) and at rest (AES-256), hosts data in secure AWS data centers, and maintains a tested disaster recovery plan. Source

Is Cymulate GDPR compliant?

Yes, Cymulate incorporates data protection by design and has a dedicated privacy and security team, including a Data Protection Officer (DPO) and Chief Information Security Officer (CISO). Source

Use Cases & Benefits

Who is the target audience for Cymulate's products?

Cymulate is designed for CISOs, security leaders, SecOps teams, red teams, vulnerability management teams, and organizations of all sizes across industries such as finance, healthcare, retail, media, transportation, and manufacturing. Source

What problems does Cymulate solve for security teams?

Cymulate addresses fragmented security tools, resource constraints, unclear risk prioritization, cloud complexity, communication barriers, inadequate threat simulation, operational inefficiencies, and post-breach recovery challenges. Case studies

What are some customer success stories with Cymulate?

Hertz Israel reduced cyber risk by 81% in four months; a sustainable energy company scaled penetration testing cost-effectively; Nemours Children's Health improved detection in hybrid/cloud environments; Saffron Building Society proved compliance for audits. Read case studies

How does Cymulate help with resource allocation and risk reduction?

Cymulate enables security teams to prioritize workload, focus on high-risk issues, and quantify risk reduction for executive reporting. Source

How does Cymulate's platform differ for various user personas?

Cymulate tailors solutions for CISOs (metrics and risk prioritization), SecOps (automation and efficiency), red teams (offensive testing), and vulnerability management teams (validation and prioritization). Learn more

Competition & Comparison

How does Cymulate differ from similar products in the market?

Cymulate offers a unified platform combining BAS, CART, and Exposure Analytics, continuous threat validation, AI-powered optimization, full kill chain coverage, ease of use, proven results (e.g., 52% reduction in critical exposures, 81% reduction in cyber risk), and continuous innovation with bi-weekly updates. Source

Support & Implementation

What support options does Cymulate provide?

Cymulate offers email support, real-time chat support, a knowledge base, webinars, e-books, and an AI chatbot for technical assistance and best practices. Email | Chat

How long does it take to implement Cymulate?

Cymulate can be implemented quickly due to its agentless mode and minimal resource requirements. Customers report immediate value and actionable insights after deployment. Source

Resources & News

Where can I find Cymulate's blog and newsroom?

Visit Cymulate's blog for the latest threats and research, and the newsroom for media mentions and press releases. Blog | Newsroom

Where can I find resources like whitepapers, product info, and thought leadership articles?

Cymulate's Resource Hub is a central location for insights, thought leadership, and product information. Resource Hub

Do you have a blog post about preventing lateral movement attacks?

Yes, Cymulate has a blog post titled 'Stopping Attackers in Their Tracks' discussing lateral movement attacks and prevention strategies. Read the blog

Cymulate named a Customers' Choice in 2025 Gartner® Peer Insights™
Learn More
New Case Study: Credit Union Boosts Threat Prevention & Detection with Cymulate
Learn More
New Research: Cymulate Research Labs Discovers Token Validation Flaw
Learn More
An Inside Look at the Technology Behind Cymulate
Learn More

How Cymulate Discovered an Abuse Risk in Google Cloud Platform (GCP)

By: Elad Beber

Last Updated: April 2, 2025

cymulate blog article

As a Vulnerability Researcher at Cymulate, I spent the last few months honing my skills in cloud environments vulnerability detection. That is a logical evolution for a former mobile security researcher doubling up as a CTF enthusiast member of the CamelRiders team.

Hunting cloud environment vulnerabilities naturally led me to set up my own GCP environment, where I recently uncovered an abuse risk in GCP's 'google-guest-agent'.

Here is the roadmap to that discovery.

The Two Layers of GCP

After gaining a pretty good knowledge of GCP attack scenarios, I started checking a lot of attack paths.

The way I saw it, there are two layers where I can search for vulnerabilities:

  • Linux layer - the Linux image with all its default services/binaries, etc.
  • GCP layer - the layer Google has added that includes services, files, etc.
    The GCP layer is new relative to the Linux layer, and this layer includes all the concepts of cloud environments (service- accounts, metadata server, cloud networking, etc.)

My goal was to find a vulnerability in the GCP layer.

Checking Attack Paths

I tried techniques like MITM, ARP poisoning, SSRF, Misconfigurations, etc.

But nothing was successful.

Though I did not find vulnerabilities, I found elements that could be used for attack scenarios.

So, after 5 months of research, I started to weaponize the knowledge accumulated during my fruitless research by developing attack scenarios.

GCP Metadata Server

Short explanation about GCP metadata:

One of the attack paths that I was pursuing was to change the values of defined properties in the metadata. As mentioned above the Metadata is stored as key: value pairs.

Let's take, for example, a metadata property:

As we can see, the key in the metadata is ‘instance/name’, and the value is Cymulate.

Attempting Key Manipulation

So, I tried to change the value of the instance name but unsuccessfully.

The user only controls the keys and values under the attribute’s property which can be ‘instance/attributes/’ or ‘project/attributes’.

When I was trying to manipulate existing keys in the metadata, I found a regex validation.

Developing Attack Scenarios

The Cymulate Exposure Management and Security Validation platform includes an advanced purple teaming framework called ‘Advanced Scenarios’ that contains executions and templates of attack scenarios. With that, I started to create attack scenarios for GCP in a variety of categories (Lateral Movement, Privilege Escalation, Persistence, etc.)

While writing the attacks, I understood GCP concepts more deeply, and I came up with more attack scenarios but nothing that led to vulnerability or an abuse risk.

Uncovering the Abuse Risk

And then, the trigger came…

One of the attacks that I implemented was to add ssh-keys at the project level, which enabled expanding our foothold on every instance under the project (Lateral Movement).

When I wrote this attack, I came up with an idea similar to the regex validation attempt mentioned above and checked if there is any validation of regex on the username to which we are adding ssh-key.

The answer was NO.

There is no validation on the username string, which means that we can write anything!!!

My first POC was a quick win. Check what happens if I add the prefix of ‘../’ to the username.

1. Here we can see the root directory before I edit the metadata.

2. After I edited the metadata, a new directory named attacker was created at the root directory!

3. Inside the attacker directory we can see our ‘publickey’ inside ‘.ssh/authorized_keys’.

It works, I just write to the root directory with a weak user! When I saw this, I realized something here is wrong. So, what the hell happened here?

Background Process

What is happening in the background is basically this scenario:

  • The GCP layer brings with her a process called ‘google-guest-agent’.
  • This process checks whether the username we submit exists.
  • If the username exists, the process creates in its home directory file named ‘.ssh/authorized_keys’ which the content will be the public key we submit into the metadata. (Don’t forget the format: ‘username:publickey’)
  • If the username doesn’t exist, the ‘google-guest-agent’ will create a new user with the home directory “/home/username” and inside this home directory the file ‘.ssh/authorized_keys’ will be created.

Path Traversal Abuse Risk

Do you realize what we did?

Because our username ‘../attacker’ doesn’t exist in the VM, the ‘google-guest-agent’ created a home directory for that username at ‘/home/{username}’ -> ‘/home/../attacker’ -> ‘/attacker’ !!!

The amazing thing here is that the ‘google-guest-agent’ is running as a root, so what we are gaining here Is Path Traversal at the entire file system at root privileges!

Abuse Risk Limitations

But there are some limitations. We can create a file and fully control its content, but we are not controlling his name (‘authorized_keys’), and, even worse, this file will be created inside a directory called ‘.ssh’

How to Exploit the Abuse Risk

So, I started wondering how I can exploit this abuse risk…I came up with some ideas and am sharing the most interesting ones here.

Linux Sudoers File

The first thing I could though about was the Linux sudoers file. Basically, the thought was that every file in the ‘/etc/sudoers.d’ will be added to the sudoers file. And If I can add users and groups to the sudoers file I will be able to do anything I want.

Here we can see the sudoers file, in the last line, we can see @includedir to ‘/etc/sudoers.d’.

I could manage to write to the ‘/etc/sudoers.d’ but there was a limitation. As I mentioned above, my file was created inside a directory called ‘.ssh’.

The @includedir we saw above in the sudoers file doesn’t mean include sub-directories ☹

It means that the content of the file inside the ‘.ssh’ directory isn’t added to the sudoers file.

Linux Crontabs

My second thought was to look for a process that doesn’t validate file names but just reads the content of files in a specific path and executes them, so I started to play with crontab.
This kind of process would be great because I could plant my malicious file in the relevant path and get code execution of my malicious payload.

There is one problem, though. The crontabs will run the execution of our malicious file on behalf of the user that is the owner of the file. This is a problem, because at the end of the creation of the files, the ‘google-guest-agent’ which is the process that creates the files, executes the ‘chown’ command to the new user that just created.

Kubernetes Privilege Container Escaping

At this moment, my team leader Roy Haimof joined me to think about other ways of exploiting this abuse risk.

Our first thought was to create a scenario presupposing an existing initial foothold in a Kubernetes Node that is running a privileged container. In that privileged container, the ‘PermitRootLogin’ property in the ‘sshd_config’ file located on the ‘/etc/ssh’ is enabled which means that a ssh connection to the root user is enabled.

The proposed attack scenario supposed that
an adversary:

  • Gains an initial foothold through a Kubernetes Node weak user, as explained above.
  • The Kubernetes Node contains a privileged container.
  • Exploits the Path traversal in order to override the ‘authorized_keys’ of the root user and adds an ssh-key.
  • Connects as a root to the privileged container
  • From the privileged container, mounts the Node file system.
  • Gains root access on the Kubernetes Node -> Container escaping -> Privilege escalation.

This idea almost worked but just one thing was missing…

If you remember, I mentioned above that, at the end of the process, the ‘google-guest-agent’ executes the ‘chown’ command on the ‘authorized_keys’ file. This is a problem because there is a check of the ssh service that verifies whether the owner of the ‘authorized_keys’ file is equal to the UID we want to connect to. And when the root UID (0) doesn’t match our new user id that has just been created, we get an error - denied public key from the ssh service.

This POC failed but we could gain a DOS attack by exploiting the Path Traversal abuse risk. We basically can override every user’s ‘authorized_keys’, therefore, we can execute denial of the ssh service to the targeted users.

Bash Injection

Our second thought was to dive into the source code of the ‘google-guest-agent’ and check if the lack of validation on the username strings can lead to bash injection. After some checks, we found out that the username passed as a string and cannot translate into a bash command.

Command Injection Leads to Privilege Escalation

From then on, we dived into the source code of the ‘google-guest-agent’. We were feeling close to finding an exploit of that abuse risk. And finally, after a couple of hours, we found a way to exploit the abuse risk. Here is the full paper that was sent to Google, which describes the abuse risk and how to exploit it with a fully documented POC.

Description

Lack of validation of the username string when adding ssh-keys to the metadata leads to privilege escalation to root through command injection.

The ‘google-guest-agent’ adds a new user when triggered by a change of the ssh-keys property in the metadata.

The username string is not validated, and due to incorrect parsing of the command by the ‘google-guest-agent’, an attacker can extend the command ‘useradd’ being executed on trigger.

An adversary could exploit this abuse risk by maliciously triggering the execution of the ‘useradd’ command with an arbitrary payload in the username string.

Figure 1: The function formatting the username controlled by the user into the ‘useradd’ command

The command is extended by adding spaces to the username (that is user controlled), since the function that formats the command splits the arguments using spaces by calling strings. Fields (Golang).

Figure 2: Documentation of the strings. Fields() function in Golang

Splitting the string causes the newly split strings to be parsed as additional arguments, therefore allowing an adversary to add flags to the command.
The command is then executed by the ‘google-guest-agent’.

Figure 3: The function that is responsible for the execution of the altered command

By creating an extension for the ‘useradd’ command, through lack of validation, an adversary could alter the command and add a new user to any group, for example, sudo group (27).

Adding an extra “-p” argument to the command allows the adversary to override the previous value passed to the “-p” flag by the ‘google-guest-agent’, therefore an adversary also controls the password of the user created, which is necessary in order to log in to the new user and escalate to root privileges.

Figure 4: The command extension, format and the final payload to be executed by the google-guest-agent

Attack Scenario Walkthrough

An adversary:

  • Gains access to a service account with permission to edit the instance metadata.
  • Injects a command extension to the username string under the ssh-keys metadata property.
  • Executes a gcloud API that updates the metadata and triggers the ‘google-guest-agent’.
  • The ‘google-guest-agent’ then executes the adversary-controlled malicious command payload.
  • A new privileged user has been created in the sudo group by the ‘google-guest-agent’ which the adversary has full control over.
  • The adversary has gained access to a user in the sudo group and therefore, has root privileges.

Proof of Concept

1. The adversary does not have sudo privileges on the victim's machine.

2. Adversary exploits command injection in order to create a new user with a custom password that will be part of the sudo group(27) by adding a malicious value to ssh-keys property in the metadata, from a file.

3. A new user called weakuser has been created, and he is part of the sudo group(27), which has the privilege to execute sudo commands.

4. The adversary is able to access the new user and therefore has escalated privileges to root.

Mitigation Measures

Firstly, ensure that only service accounts you trust have permission to edit the metadata. Editing metadata is a high privilege. The next mitigation is to enable the OS-Login property in the metadata by adding "enable-oslogin=TRUE" to the metadata.

What is OS-Login?

OS-Login is a feature that is used to manage SSH access to instances using IAM without having to create and manage individual SSH keys. OS-Login maintains a consistent Linux user identity across VM instances and is the recommended way to manage many users across multiple instances or projects. When OS-Login is enabled, all the SSH connections will be made by authenticated users from the IAM.

How does enabling OS-Login protects you from attacks?

When OS-Login is enabled, the ‘google-guest-agent’ will not maintain connections to the instance via SSH keys. It will also remove the value of the ‘ssh-keys’ property in the metadata, which means that no matter which malicious username the attacker will use, it is not relevant due to a deletion of the ‘ssh-keys’ value by the ‘google-guest-agent’.

You may ask yourself that if an attacker can edit the metadata, why wouldn’t he just disable OS-Login?

Yes, he could as long we didn’t use the OS-Login organization policy ?

To ensure that all new projects, and the VM instances created in these new projects, have OS-Login enabled, you can set up the following OS-Login constraint in your organization:

“gcloud beta resource-manager org-policies enable-enforce compute.requireOsLogin --organization=organization-id”

To read the documentation for managing OS-Login, see - Manage OS Login in an organization

Conclusion

I wish I could claim to be a genius and the only one capable of uncovering an abuse risk missed by the SecDevOps of as prestigious an entity as Google, but I am afraid I am not.

The truth is that only security researchers and committed cyber-attackers have the time and resources to look for such vulnerabilities and abuse risks. There is a constant race between security Researchers and threat actors to uncover them, but vulnerabilities are there in any and all environments - and uncovered they will be, either by your team or by cyber attackers.

The best protection is to ensure that your own environment security controls are optimally configured so that, even if a supplier – GCP or other – contains exploitable vulnerabilities and abuse risks, your own security controls will compensate and minimize its reach in your environment.

Cymulate’s BAS and Purple Teaming Enablement validate that your security controls are optimally configured and ready to stop, or at least spot, a cyber attacker hitching a ride on a supplier’s exploited vulnerability and abuse risks.

Cymulate Exposure Validation makes advanced security testing fast and easy. When it comes to building custom attack chains, it's all right in front of you in one place.
Mike Humbert, Cybersecurity Engineer
DARLING INGREDIENTS INC.
Learn More
Book a Demo