Tenable has shared details on a dependency confusion attack method that could have exposed Google Cloud Platform (GCP) customers to remote code execution (RCE) attacks.
The issue, dubbed CloudImposer, could have allowed attackers to hijack an internal software dependency pre-installed on each instance of Google’s Cloud Composer pipeline-orchestration tool. GCP’s App Engine and Cloud Function services were also affected.
According to Tenable, the root cause of the issue was the use of the ‘–extra-index-url’ argument in Python, which instructs applications to look for private dependencies in the public registry (PyPI), in addition to the specified private registry.
“This behavior opens the door for attackers to carry out a dependency confusion attack: upload a malicious package with the same name as a legit package to hijack the package-installation process,” Tenable notes.
An attacker could also take advantage of other circumstances, such as the fact that ‘pip’, the Python package installer, prioritizes the package with higher versioning number when encountering two packages with the same name.
When it comes to Cloud Composer, things were not better. In fact, Tenable discovered that, when instructed to install only a specific version of a package, pip would prioritize the public registry if the –extra-index-url argument was used.
Both Python Packaging and GCP documentation were found to recommend the use of the ‘–extra-index-url’ argument when hosting dependencies in private repositories, and the trust developers place in package management systems opened the door wide for dependency confusion.
Google itself used the argument when installing private packages on its servers and, after identifying a referenced package that was not present in the public registry, Tenable created their own package with the same name, uploaded it to a public repository, and launched the dependency confusion attack against Cloud Composer, Google’s managed service version of Apache Airflow.
After successfully verifying that the proof-of-concept (PoC) resulted in the execution of code on Google’s internal servers, Tenable reported the CloudImposer vulnerability to the internet giant, which classified it as an RCE bug and patched it immediately.
Google also updated its GCP documentation to remove the recommendation to use the –extra-index-url argument, replacing it with the –index-url argument, which only looks for packages in defined registries, thus reducing the risk of dependency confusion attacks.
Tenable also reported the identified issues to the Python Software Foundation, which said that, while a paper on mitigating the risk of dependency confusion attacks was submitted in February 2023, no implementation has been accepted or completed.
The cybersecurity firm presented its research at the BlackHat USA 2024 conference, where it explained how a vulnerability such as CloudImposer could be exploited to impact cloud interconnected services.
Just like in the Jenga game, cloud providers tend to build their services on top of each other, meaning that, if one is attacked, all other services are impacted as well, Tenable said.
Related: Google Introduces ‘Air-Gapped’ Backup Vault to Thwart Ransomware
Related: GitLab Updates Resolve Critical Pipeline Execution Vulnerability
Related: Google Introduces New Capabilities for Cloud Armor Web Security Service
Related: Google Patches Vulnerability in Cloud Endpoints Proxy