Google Addresses Cloud Run Vulnerability Enabling Unauthorized Access to Private Container Images

In a recent development, Google has rectified a security vulnerability within its Cloud Run service that previously allowed unauthorized access to private container images. This flaw, identified by Tenable security researcher Liv Matan and dubbed “ImageRunner,” could have permitted individuals with specific permissions to exploit their access, potentially leading to the deployment of malicious code.

Understanding the Vulnerability

Google Cloud Run is a fully managed platform designed to execute containerized applications in a serverless environment. Typically, when deploying a service, Cloud Run retrieves container images from repositories like the Artifact Registry or Docker Hub. The identified issue arose from certain identities possessing edit permissions on Cloud Run revisions without corresponding permissions on container registries.

Each deployment or update of a Cloud Run service results in the creation of a new revision. During this process, a service agent account is responsible for pulling the necessary images. An attacker with specific permissions—namely, `run.services.update` and `iam.serviceAccounts.actAs`—could modify a Cloud Run service to deploy a new revision. This modification could specify any private container image within the same project for the service to pull, thereby accessing sensitive or proprietary images stored in the victim’s registries.

Potential Risks and Exploitation

The exploitation of this vulnerability could have significant consequences. An attacker could introduce malicious instructions into the container images, leading to:

– Data Exfiltration: Extracting sensitive information from the compromised environment.

– Secret Extraction: Accessing confidential credentials or keys.

– Remote Code Execution: Establishing a reverse shell to control the victim’s machine remotely.

Such actions could compromise the integrity and confidentiality of the affected systems, leading to potential data breaches and unauthorized access.

Google’s Response and Mitigation Measures

Upon responsible disclosure by Tenable, Google promptly addressed the issue. As of January 28, 2025, the patch ensures that any user or service account creating or updating a Cloud Run resource must have explicit permission to access the container images. Specifically, when using the Artifact Registry, the principal must possess the Artifact Registry Reader (`roles/artifactregistry.reader`) IAM role on the project or repository containing the container images to be deployed.

This update reinforces the security model by ensuring that only authorized entities can access and deploy container images, thereby mitigating the risk of unauthorized access and potential exploitation.

Broader Implications and the “Jenga” Effect

Tenable has characterized the ImageRunner vulnerability as an instance of what they term “Jenga.” This concept highlights the interconnected nature of cloud services, where a security flaw in one service can cascade, introducing risks to other dependent services. In this scenario, the vulnerability in Cloud Run could have had broader implications due to its integration with other Google Cloud services.

This interconnectedness underscores the importance of comprehensive security assessments and the need for cloud providers to ensure that the foundational services are robust and secure.

Recommendations for Cloud Run Users

To ensure the security of their deployments, users of Google Cloud Run should:

1. Review IAM Roles: Verify that only necessary permissions are granted to users and service accounts, adhering to the principle of least privilege.

2. Monitor Deployments: Implement monitoring to detect unauthorized changes or deployments within Cloud Run services.

3. Stay Informed: Regularly review security bulletins and updates from Google Cloud to stay informed about potential vulnerabilities and recommended mitigations.

By proactively managing permissions and staying vigilant, organizations can enhance their security posture and reduce the risk of unauthorized access.

Conclusion

The prompt identification and remediation of the ImageRunner vulnerability by Google highlight the critical importance of continuous security monitoring and the need for robust access controls in cloud environments. As cloud services become increasingly integrated and complex, maintaining a strong security posture requires vigilance, timely updates, and adherence to best practices in identity and access management.