Varonis Details Cross-Tenant Code Execution Risk in Google Cloud Dataflow

· Original article ↗

Summary

Varonis Threat Labs describes how predictable Dataflow staging buckets and a swapped Python session pickle could enable cross-tenant code execution. Google says global fixes add bucket-ownership checks and SHA-256 artifact verification.

Key points

  • The researchers describe a risk affecting certain Apache Beam Python pipelines using the default staging bucket and --save_main_session, before the project had created that bucket in the region.
  • Beam derived the default bucket name from the project ID and region; the Python SDK did not verify that a pre-existing bucket belonged to the victim project.
  • An attacker could reportedly squat the bucket, replace the staged pickled_main_session, and have Dataflow workers execute code when they unpickled the artifact.
  • The described payload could access the worker service account’s identity and token; potential impact depended on that account’s permissions.
  • Google’s global mitigations include a Beam Python SDK ownership check, server-side Dataflow bucket-ownership enforcement, and SHA-256 verification of staged artifacts.
  • The researchers note that explicitly configured staging or temporary buckets remain dependent on their owners’ access controls, and that pickle can execute code by design.

Article Details

Attack Vectors
  • An attacker precomputes a predictable default Dataflow staging-bucket name from a target project ID and region, creates the bucket in an attacker-owned project, and grants AllUsers read/write access.
  • When a qualifying Python Beam pipeline uses the default staging bucket and --save_main_session, the pipeline stages its pickled session in the squatted bucket. The attacker watches for the file, replaces it with a malicious pickle, and workers may execute the payload when they unpickle it.
  • The payload can query the instance metadata server for the Dataflow worker service account's identity and access token, then exfiltrate them to an attacker-controlled endpoint.
Defensive Notes
  • Google reports that global mitigations are deployed: Beam 2.75.0 and later checks ownership of pre-existing default buckets, and the Dataflow service independently rejects default buckets owned by another project.
  • Dataflow workers verify SHA-256 digests of staged artifacts at startup and abort if an artifact was modified after staging.
  • For explicitly configured staging or temporary buckets, restrict access and secure the project that owns them; the article says default-bucket ownership checks do not apply to explicitly configured buckets.
  • Treat write access to staging storage as equivalent to write access to pipeline code, since --save_main_session still uses pickle, which can execute code when deserialized.

MITRE ATT&CK

Vendors

Products

Related Articles