Remote Code Execution Vulnerability in Google They Are Not Willing To Fix
A private Python package name was discovered in a public GitHub repository, and the researcher uploaded a public package with the same name to PyPI. When Google employees installed the package, it executed code that sent hostname and username to the researcher, demonstrating dependency confusion and potential remote code execution.
Published on giraffesecurity.dev
This is a story about a security vulnerability in Google that allowed me to run arbitrary code on the computers of 50+ Google employees. Although Google initially considered my finding a serious security incident, later on, it changed its mind and stated that my finding is not, in fact, a vulnerability, but the…
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.
Context
This is an account of a dependency confusion vulnerability affecting Google. Dependency confusion is a software misconfiguration in which a package intended to be pulled from a private package repository is instead downloaded from a public repository, for example npmjs.org in the case of NPM. In most scenarios an attacker finds the name of a private package and uploads a package with the same name to the public repository. The attacker can include any code in the package, and in most languages that code runs arbitrary code already at install time, which makes dependency confusion particularly dangerous.
The target here was not a web endpoint but a Python package, referred to throughout as package X, that appeared to be an internal Google tool. The researcher's own asset, giraffesecurity.dev, is where the write-up was published.
From an exploit complexity perspective, dependency confusion is easy to exploit: all you have to do is upload a package to the public package repository and wait for the package to be downloaded. Anyone can do this and it requires no special skills. The hard part is identifying the private packages that are susceptible, because companies usually keep their private packages and the projects that use them private, so you cannot simply look at a company's GitHub and expect to find all the vulnerable projects together with the names of private dependencies.
The names of internal packages are usually not guarded with top-level security measures. For code deployed to the front end, package names may be included in the code bundle. And while it is not possible to determine which packages would be downloaded because of dependency confusion, researchers and malicious actors can upload all the potential packages they find; the worst that can happen is that the uploaded package is never downloaded.
Setup
No accounts, roles or special tooling are described beyond the following:
- A scanner written by the researcher that automatically finds private package names from publicly available source code hosted on sites like GitHub.
- A web server hosted by the researcher to receive callbacks from the uploaded package.
- A PyPi account able to publish a package under the discovered name.
The method for automatically discovering package names was simple. The scanner looked through GitHub repositories for lists of dependencies in common formats and looked for dependencies that were part of a dependency list but had no matching package in the public package repository. For Python, it looked at lists matching the output of the pip freeze command and for packages that were not present in PyPi. The search space was constrained to repositories owned by an organisation related to major technology companies, such as Google or Microsoft, and to repositories owned by employees of these companies. A GitHub user was considered an employee if they had set their company in GitHub to a large tech company, for example if they had the @google tag on their profile.
Finding it
One of the matches of the scanner came from a public repository belonging to a Google employee. The scanner found a reference to a non-existent package, package X, in one of the files in the repository. A GitHub search for the package name revealed three more references to the same package on GitHub. All the matches came from employees and ex-employees of Google, which gave early confidence that the package was owned by Google.
The reference to package X was in a requirements.txt file, so it was a Python package. That was good news for the researcher because Python is a language with, in their words, unarguably the worst dependency management system. With Python it is extremely easy to misconfigure installation scripts to be prone to dependency confusion. The report gives this example shell command, which installs private package kaboom from a private registry and is vulnerable to dependency confusion:
pip install kaboom –extra-index-url https://example.com
The point of the example is the extra-index-url parameter. A reader who works with Python daily and keeps up with security knows that extra-index-url is a no-go for installing private packages. Despite having been known for years, it is still used widely because ordinary users do not consider the security implications when using the parameter. The report links to a GitHub discussion with 100+ comments on the topic: https://github.com/pypa/pip/issues/8606.
Exploitation
Step 1: Claim the name on PyPi
After finding package X in the GitHub repository, the next step was to upload a public package with that name to PyPi, the default Python package repository.
Step 2: Add a callback to the install script
In the installation script of the public package, the researcher included code that would send an HTTP request with the current hostname and username to a web server they hosted. That allowed detection of when the package was installed at Google and is described as the go-to method for confirming dependency confusion vulnerabilities.
Step 3: Wait for downloads
After uploading the package, it took about two weeks until downloads started arriving, at a rate of roughly one download per day. The downloads came from computers or virtual desktops of Google employees around the world. They spanned different roles, such as software engineers and firmware engineers (according to LinkedIn), and different countries, including the United States, Belgium and China. Interestingly, the downloads came solely from hosts associated with specific people and not from automated builds or from Google services. The researcher's hypothesis is that package X is an internal tool used only locally and not part of any Google product deployments.
Step 4: Report and first response
Upon receiving the first real download within Google, the researcher reported the vulnerability to Google's vulnerability reward program. At first Google acted quickly and classified the bug as S0, the highest severity in their vulnerability reward program. They fixed the issue in about two weeks and awarded a bounty of $500. During those two weeks the package was installed on roughly 15 unique hosts.

The screenshot shows the email conversation with Google after the first submission.
To add credibility to the story, the report lists details of a few hosts where the researcher's version of package X was installed:
| IP address | Hostname | Username |
|---|---|---|
| [redacted] | [redacted] | [redacted] |
| [redacted] | [redacted] | [redacted] |
| [redacted] | [redacted] | [redacted] |
| [redacted] | [redacted] | [redacted] |
| [redacted] | [redacted] | [redacted] |
| [redacted] | [redacted] | [redacted] |
Step 5: The issue resurfaces
A few weeks after the patch, the researcher started once again receiving downloads from employee devices. They made a new report to Google saying that the issue had resurfaced. This time Google closed the report, stating that it was not in fact a security vulnerability and that the software was working as intended. They also said the vulnerability included social engineering, which is out of scope of the vulnerability reward program. That was confusing for the researcher, since the bug involves zero social engineering. They made several attempts to highlight the impact of the bug and how it does not involve social engineering. In the end the decision was the same: everything is working as intended.


The two screenshots show Google's replies after the bug was reported again and after the researcher tried once more to explain it.
Step 6: The package keeps being installed
At the time of writing, it had been a week since the last communication, and the Python package was still being downloaded by Googlers every day. The researcher notes that if they wanted to, they could replace the current version of the package with something malicious, and it would start running on Google employees' computers and virtual desktops.
Root cause
The underlying mistake is the one common to dependency confusion: a private package name that is not present in the public repository is resolved from the public repository, so whoever claims the name first controls what gets installed. In this case the name was discoverable because a reference to package X sat in a requirements.txt file in a public GitHub repository belonging to a Google employee, and further references existed in other repositories from employees and ex-employees. The report does not show the exact pip configuration that caused the public package to be preferred, so the precise mechanism on Google's side is not stated; the example given for the class of bug is the use of extra-index-url, which lets pip consider both indexes and pick the package from either.
Existing defences did not stop it. The name was unclaimed on PyPi, so anyone could register it, and the report notes that only one person can claim a package on PyPi. The first fix addressed the specific package but, as the researcher points out, was not robust: there may be other private packages that could be used in place of package X.
Impact
An attacker who claims the name can run arbitrary code on the machines that install the package, at install time. In this case the researcher's benign payload ran on computers and virtual desktops of Google employees across several countries and roles, roughly 15 unique hosts during the two weeks before the first fix, and downloads continued afterwards at about one per day. The report opens by saying the vulnerability allowed the researcher to run arbitrary code on the computers of 50+ Google employees. Because the affected environments are not plain OS installations with no data, the researcher argues they should still contain something worth protecting, such as proprietary source code. The report hedges that, not having worked at Google, the researcher does not know their security practices and that it is possible everything runs in isolated environments where the risk is extremely low.
The report also notes that the same GitHub repository contained five more references to non-existent private packages, whose names are not disclosed. Judging by their names they are likely internal tools installed in the same way, and the researcher says anyone could find them with a similar scan. There are likely even more packages that were not found, since only a small fraction of the data was scanned.
Fix
Google's first response was to fix the issue in about two weeks, but the report does not describe what that fix consisted of. The researcher notes that Google had a very easy way to fix the specific issue from the start: have package X removed from PyPi by staff and have the name blacklisted so it cannot be claimed again. Other companies to whom the researcher reported dependency confusion issues have done this, and it guarantees the same package cannot be used for dependency confusion in the future. The researcher is explicit that this is not a robust fix, since other private packages could be used in place of package X.
After the issue resurfaced, Google closed the new report as working as intended, so no further fix is described.
On the bounty, the report's footnote (updated 15 April 2023) addresses why the award was only $500 and shows Google's explanation:

The screenshot shows Google's reply explaining the bounty amount.
Variants to test
- Scan public repositories for dependency lists in common formats and look for entries with no matching package in the public registry. A positive result is a name referenced by an organisation's or employee's repository that is unclaimed on the public registry.
- Repeat the scan across ecosystems, not just Python: the report describes the approach generically for lists of dependencies in common formats, with
pip freezeoutput as the Python example. A positive result is the same mismatch in another ecosystem's manifest or lock file. - Widen the set of repositories considered, since the researcher only scanned a small fraction of the data. A positive result is additional unclaimed private names tied to the target organisation.
- After claiming a name, publish a package whose install script reports the hostname and username to a server you control, as the researcher did. A positive result is callbacks from hosts associated with the target, especially from individual machines rather than automated builds.
- Watch for the issue resurfacing after a fix. In this case downloads resumed a few weeks after the patch. A positive result is new callbacks from the same organisation after the reported fix.
What happened, in plain words
A security researcher found a vulnerability that allowed running their own code on the computers of 50+ Google employees. Google first treated it as a serious incident, fixed it, and paid a reward. When the same problem came back a few weeks later, Google said it was not a security problem at all and that the software was working as intended. The researcher disagreed and published the story.
The trick behind it is called dependency confusion. To understand it, you need one idea first: modern software is rarely written from scratch. Programmers build their programs out of ready-made pieces called packages, which they download from online libraries. A package is a bundle of code that someone else wrote and published, and installing it is normally as simple as typing one command.
Think of it like a recipe that says "buy the sauce from the shop on the corner". If the shop on the corner does not stock that sauce, but a stranger opens a stall with the same name and sells a bottle labelled the same way, the cook may buy the stranger's bottle without noticing. The recipe did not change; the supply did.
That is dependency confusion: a company means to download a private package from its own internal library, but because of a configuration mistake the computer also looks in the public library, and if a package with the same name exists there, it may download that one instead. Whoever uploaded the public package decides what code runs. In many programming languages, that code runs the moment the package is installed, before anyone even uses it. That is why this class of bug is dangerous.
The researcher did not break into any Google website. They found the name of an internal Google package that was mentioned in public code on GitHub, uploaded a package with that same name to the public Python library, and waited. Google employees' computers downloaded it, and the package quietly reported back. The researcher's code was harmless, but it could have been anything.
The idea behind the attack
Dependency confusion is easy to carry out. All you have to do is upload a package to the public package repository and wait for the package to be downloaded. Anyone can do this and it requires no special skills.
The hard part is finding which private packages are vulnerable. Companies usually keep their private packages and the projects that use them private, so you cannot simply look at a company's GitHub and expect to find all the vulnerable projects together with the names of private dependencies.
But the names of internal packages are usually not guarded with top-level security measures. For code that is deployed to the front end (the part of a website that runs in your browser), package names may be included in the code bundle that the browser downloads. And while it is not possible to know in advance which packages would be downloaded because of dependency confusion, researchers and malicious actors can upload all the potential packages they find. The worst that can happen is that the uploaded package is never downloaded.
Setting up
The report does not describe any accounts, roles or special tooling beyond three things:
- A scanner written by the researcher that automatically finds private package names from publicly available source code hosted on sites like GitHub.
- A web server hosted by the researcher to receive callbacks from the uploaded package.
- A PyPi account able to publish a package under the discovered name.
A scanner here is just a small program that reads a lot of files automatically and flags anything that matches a pattern, like a metal detector sweeping a beach. GitHub is a website where programmers store and share code; much of it is public. PyPi is the public library for Python packages: the place where anyone can publish a package and anyone can download one.
The method for automatically discovering package names was simple. The scanner looked through GitHub repositories for lists of dependencies in common formats and looked for dependencies that were part of a dependency list but had no matching package in the public package repository. For Python, it looked at lists matching the output of the pip freeze command and for packages that were not present in PyPi.
A dependency list is simply a file that says which packages a project needs. pip is the tool Python programmers use to install packages, and pip freeze prints the list of everything currently installed. If a name appears in such a list but does not exist in the public library, that is a strong hint that it is a private package, and therefore a candidate for the attack.
The search space was constrained to repositories owned by an organisation related to major technology companies, such as Google or Microsoft, and to repositories owned by employees of these companies. A GitHub user was considered an employee if they had set their company in GitHub to a large tech company, for example if they had the @google tag on their profile. That tag is just a line of text on a public profile page, but it is enough to narrow the search.
Finding it
One of the matches of the scanner came from a public repository belonging to a Google employee. The scanner found a reference to a non-existent package, called package X from then on, in one of the files in the repository. A GitHub search for the package name revealed three more references to the same package on GitHub. All the matches came from employees and ex-employees of Google, which gave early confidence that the package was owned by Google.
The reference to package X was in a requirements.txt file, so it was a Python package. That file is the standard shopping list for a Python project: one package name per line. The fact that it was Python was good news for the researcher, because in their words Python has unarguably the worst dependency management system. With Python it is extremely easy to misconfigure installation scripts to be prone to dependency confusion.
The report gives this example shell command, which installs private package kaboom from a private registry and is vulnerable to dependency confusion:
pip install kaboom –extra-index-url https://example.com
Line by line:
pip install kaboomtells Python's package installer to fetch and install a package calledkaboom.–extra-index-url https://example.comadds a second place to look for packages, in this example a private registry athttps://example.com.
The problem is that with two places to look, the installer may find a package with the right name in either of them. If a stranger has published a kaboom in the public library, the installer can pick that one instead of the private one. A reader who works with Python daily and keeps up with security knows that extra-index-url is a no-go for installing private packages. Despite having been known for years, it is still used widely because ordinary users do not consider the security implications when using the parameter. The report links to a GitHub discussion with 100+ comments on the topic: https://github.com/pypa/pip/issues/8606.
Carrying out the attack
Step 1: Claim the name on PyPi
After finding package X in the GitHub repository, the next step was to upload a public package with that name to PyPi, the default Python package repository. On PyPi, package names are first come, first served: only one person can claim a package name. On PyPi, only one person can claim a package name.
Step 2: Add a callback to the install script
In the installation script of the public package, the researcher included code that would send an HTTP request with the current hostname and username to a web server they hosted.
An install script is code that runs automatically while a package is being installed. An HTTP request is the same kind of message your browser sends when it loads a page; here it is sent by the package to a server the researcher controls. The hostname is the computer's name on the network, and the username is the account name of the person using it. Together they act like a return address on an envelope: when the researcher's server receives one, it knows that a particular machine installed the package. That allowed detection of when the package was installed at Google and is described as the go-to method for confirming dependency confusion vulnerabilities.
Step 3: Wait for downloads
After uploading the package, it took about two weeks until downloads started arriving, at a rate of roughly one download per day. The downloads came from computers or virtual desktops of Google employees around the world. A virtual desktop is a desktop environment that runs on a remote server rather than on the machine in front of the person. The downloads spanned different roles, such as software engineers and firmware engineers (according to LinkedIn), and different countries, including the United States, Belgium and China.
Interestingly, the downloads came solely from hosts associated with specific people and not from automated builds or from Google services. An automated build is a machine that assembles software on its own, with no person involved. The researcher's hypothesis is that package X is an internal tool used only locally and not part of any Google product deployments.
Step 4: Report and first response
Upon receiving the first real download within Google, the researcher reported the vulnerability to Google's vulnerability reward program. That is a scheme where companies pay people who report security bugs to them, so the bugs get fixed instead of sold or kept quiet. At first Google acted quickly and classified the bug as S0, the highest severity in their vulnerability reward program. They fixed the issue in about two weeks and awarded a bounty of $500. During those two weeks the package was installed on roughly 15 unique hosts.

The screenshot shows the email conversation with Google after the first submission.
To add credibility to the story, the report lists details of a few hosts where the researcher's version of package X was installed:
| IP address | Hostname | Username |
|---|---|---|
| [redacted] | [redacted] | [redacted] |
| [redacted] | [redacted] | [redacted] |
| [redacted] | [redacted] | [redacted] |
| [redacted] | [redacted] | [redacted] |
| [redacted] | [redacted] | [redacted] |
| [redacted] | [redacted] | [redacted] |
An IP address is the numeric address of a machine on a network, a bit like a postal address for computers. The hostname is the human-readable name of that machine, and the username is the account that ran the install. Together they show that the package really did land on individual Google machines.
Step 5: The issue comes back
A few weeks after the patch, the researcher started once again receiving downloads from employee devices. They made a new report to Google saying that the issue had resurfaced. This time Google closed the report, stating that it was not in fact a security vulnerability and that the software was working as intended. They also said the vulnerability included social engineering, which is out of scope of the vulnerability reward program.
Social engineering means tricking a person into doing something, such as clicking a link or installing a program, rather than attacking a machine directly. That was confusing for the researcher, since the bug involves zero social engineering: nobody was tricked, the computers fetched the package by themselves. They made several attempts to highlight the impact of the bug and how it does not involve social engineering. In the end the decision was the same: everything is working as intended.


The two screenshots show Google's replies after the bug was reported again and after the researcher tried once more to explain it.
Step 6: The package keeps being installed
At the time of writing, it had been a week since the last communication, and the Python package was still being downloaded by Googlers every day. The researcher notes that if they wanted to, they could replace the current version of the package with something malicious, and it would start running on Google employees' computers and virtual desktops. That is the heart of the risk: the same channel that delivered a harmless report could deliver anything.
Why it worked
The underlying mistake is the one common to dependency confusion: a private package name that is not present in the public repository is resolved from the public repository, so whoever claims the name first controls what gets installed. In this case the name was discoverable because a reference to package X sat in a requirements.txt file in a public GitHub repository belonging to a Google employee, and further references existed in other repositories from employees and ex-employees. The report does not show the exact pip configuration that caused the public package to be preferred, so the precise mechanism on Google's side is not stated. The example given for the class of bug is the use of extra-index-url, which lets pip consider both indexes and pick the package from either.
Existing defences did not stop it. The name was unclaimed on PyPi, so anyone could register it, and the report notes that only one person can claim a package on PyPi. The first fix addressed the specific package but, as the researcher points out, was not robust: there may be other private packages that could be used in place of package X.
What the impact was
An attacker who claims the name can run arbitrary code on the machines that install the package, at install time. Arbitrary code means any code at all, chosen by the attacker. In this case the researcher's benign payload ran on computers and virtual desktops of Google employees across several countries and roles, roughly 15 unique hosts during the two weeks before the first fix, and downloads continued afterwards at about one per day. The report states that the researcher could have run arbitrary code on the computers of 50+ Google employees.
Because the affected environments are not plain OS installations with no data, the researcher argues they should still contain something worth protecting, such as proprietary source code. The report hedges that, not having worked at Google, the researcher does not know their security practices and that it is possible everything runs in isolated environments where the risk is extremely low.
The report also notes that the same GitHub repository contained five more references to non-existent private packages, whose names are not disclosed. Judging by their names they are likely internal tools installed in the same way, and the researcher says anyone could find them with a similar scan. There are likely even more packages that were not found, since only a small fraction of the data was scanned.
The fix
The researcher notes that Google had a very easy way to fix the specific issue from the start: have package X removed from PyPi by staff and have the name blacklisted so it cannot be claimed again. Other companies to whom the researcher reported dependency confusion issues have done this, and it guarantees the same package cannot be used for dependency confusion in the future. The researcher is explicit that this is not a robust fix, since other private packages could be used in place of package X.
After the issue resurfaced, Google closed the new report as working as intended, so no further fix is described.
On the bounty, the report's footnote (updated 15 April 2023) addresses why the award was only $500 and shows Google's explanation:

The screenshot shows Google's reply explaining the bounty amount.
How to look for the same thing yourself
- Scan public repositories for dependency lists in common formats and look for entries with no matching package in the public registry. A positive result is a name referenced by an organisation's or employee's repository that is unclaimed on the public registry.
- Repeat the scan across ecosystems, not just Python: the report describes the approach generically for lists of dependencies in common formats, with
pip freezeoutput as the Python example. A positive result is the same mismatch in another ecosystem's manifest or lock file. - Widen the set of repositories considered, since the researcher only scanned a small fraction of the data. A positive result is additional unclaimed private names tied to the target organisation.
- After claiming a name, publish a package whose install script reports the hostname and username to a server you control, as the researcher did. A positive result is callbacks from hosts associated with the target, especially from individual machines rather than automated builds.
- Watch for the issue resurfacing after a fix. In this case downloads resumed a few weeks after the patch. A positive result is new callbacks from the same organisation after the reported fix.
Glossary
- Package: a bundle of ready-made code that programmers download and reuse instead of writing everything themselves.
- Package repository: an online library where packages are published and downloaded, such as PyPi for Python.
- PyPi: the default public repository for Python packages.
- pip: the tool Python programmers use to install packages.
pip freeze: a pip command that prints the list of packages currently installed, in a format often copied into a dependency list.- Dependency: a package that a project needs in order to work.
- Dependency list: a file listing the packages a project needs, such as
requirements.txt. requirements.txt: the standard dependency list file for a Python project.- Dependency confusion: a misconfiguration where a package meant to come from a private repository is instead downloaded from a public one, letting whoever claimed the name control the code.
- Private registry: a package repository that only a company's own systems can reach.
extra-index-url: a pip option that adds a second place to look for packages, which can let a public package win over a private one.- Install script: code inside a package that runs automatically while the package is being installed.
- Arbitrary code execution: running any code the attacker chooses on a victim's machine.
- HTTP request: a message a program sends over the network to a server, the same kind of message a browser sends when loading a page.
- Callback: a request sent back to a server the attacker controls, used here to confirm that a package was installed.
- Hostname: the human-readable name of a machine on a network.
- IP address: the numeric address of a machine on a network.
- Username: the name of the account a person uses on a machine.
- Virtual desktop: a desktop environment that runs on a remote server rather than on the machine in front of the person.
- Automated build: a machine that assembles software on its own, with no person involved.
- GitHub: a website where programmers store and share code, much of it public.
- Repository: a project's folder of code and history on a site like GitHub.
- Scanner: a small program that reads many files automatically and flags anything matching a pattern.
- Front end: the part of a website that runs in the visitor's browser.
- Code bundle: the combined file of code that a website sends to the browser.
- Vulnerability: a weakness in software that someone can abuse to make it behave in a way its maker did not intend.
- Vulnerability reward program: a scheme where a company pays people who report security bugs to it.
- S0: the highest severity level in Google's vulnerability reward program, as used in this report.
- Bounty: the money paid for a reported bug.
- Social engineering: tricking a person into doing something, such as installing a program, rather than attacking a machine directly.
- Out of scope: outside the rules of a reward program, so not eligible for a reward.
- Working as intended: the vendor's position that the behaviour is by design and not a bug.
- Blacklist: a list of names that a platform refuses to hand out or accept, used here to stop a package name being claimed again.