Synopsis
Tenable Research has discovered a privilege escalation vulnerability affecting Google Cloud Composer. This vulnerability allows an identity with the composer.environments.update permission to escalate privileges to the default Cloud Build service account, which holds elevated permissions within Google Cloud environments.
The vulnerability exploits the process of adding custom PyPI packages to Cloud Composer. During this process, a Cloud Build instance is automatically initiated by the Composer service account, which attaches the default Cloud Build service account with elevated permissions. By uploading a malicious PyPI package, attackers can inject code that executes during the build process, exfiltrating the token of the Cloud Build service account from its metadata.
This attack technique was previously reported in Google Cloud Functions by Tenable and was dubbed ConfusedFunction, but a variant of the vulnerability persists in Cloud Composer.
Solution
Previously, during update operations performing PyPI modules installation, Composer used the Cloud Build service account (which might have had broader permissions than the user performing the operation). After implementing the fix, Composer will stop using Cloud Build service account and instead will use Composer environment service account for performing PyPI module installations.
This has been rolled out to new Composer instances already and existing instances should be updated to exhibit this behavior in April 2025.
In addition, this report led to several updates to our Composer documentation, such as to the sections on Access Control, Installing Python Dependencies, and Accessing the Airflow CLI.
This fix has been rolled out to new Composer instances already (rel. notes) and existing instances should be updated to exhibit this behavior in April (rel. notes).
Additional References
https://cloud.google.com/composer/docs/composer-2/access-control#:~:text=The%20composer.environments,with%20such%20codehttps://cloud.google.com/composer/docs/composer-2/install-python-dependencies#:~:text=Important%3A%20When,Access%20control
https://cloud.google.com/composer/docs/composer-3/access-airflow-cli#:~:text=Caution%3A%20Users%20with%20the%20composer.environment.executeairflowcommand%20permission%20can%20execute%20Python%20code%20available%20to%20Airflow%20components%20on%20behalf%20of%20the%20environment%27s%20service%20account.%20For%20more%20information%2C%20see%20Access%20control
Disclosure Timeline
All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.
Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.
For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.
If you have questions or corrections about this advisory, please email [email protected]