INCIDENT MAP

Browse / Sensitive Data Disclosure / AML.CS0023

ShadowRay: Hijacking Exposed Ray Clusters

AML.CS0023 · 2023-09-05 case study

Class
Sensitive Data Disclosure
Technique
Unsecured Credentials
Also involves
Unsafe Model Loading and Supply Chain, Model Theft and Extraction, Misinformation and External Harm
Target
Exposed Ray Clusters (Incident)

How it worked

  1. Reconnaissance · Active Scanning

    Adversaries can scan for public IP addresses to identify those potentially hosting Ray dashboards. Ray dashboards, by default, run on all network interfaces, which can expose them to the public internet if no other protective mechanisms are in place on the system.

  2. Initial Access · Exploit Public-Facing Application

    Once open Ray clusters have been identified, adversaries could use the Jobs API to invoke jobs onto accessible clusters. The Jobs API does not support any kind of authorization, so anyone with network access to the cluster can execute arbitrary code remotely.

  3. Collection · AI Artifact Collection

    Adversaries could collect AI artifacts including production models and data.

    The researchers observed running production workloads from several organizations from a variety of industries.

  4. Credential Access · Unsecured Credentials

    The attackers could collect unsecured credentials stored in the cluster.

    The researchers observed SSH keys, OpenAI tokens, HuggingFace tokens, Stripe tokens, cloud environment keys (AWS, GCP, Azure, Lambda Labs), Kubernetes secrets.

  5. Exfiltration · Exfiltration via Cyber Means

    AI artifacts, credentials, and other valuable information can be exfiltrated via cyber means.

    The researchers found evidence of reverse shells on vulnerable clusters. They can be used to maintain persistence, continue to run arbitrary code, and exfiltrate.

  6. Initial Access · Supply Chain Compromise: Model Repository

    HuggingFace tokens could allow the adversary to replace the victim organization's models with malicious variants.

  7. Impact · External Harms: Financial Harm

    Adversaries can cause financial harm to the victim organization. Exfiltrated credentials could be used to deplete credits or drain accounts. The GPU cloud resources themselves are costly. The researchers found evidence of cryptocurrency miners on vulnerable Ray clusters.

Summary

Ray is an open-source Python framework for scaling production AI workflows. Ray's Job API allows for arbitrary remote execution by design. However, it does not offer authentication, and the default configuration may expose the cluster to the internet. Researchers at Oligo discovered that Ray clusters have been actively exploited for at least seven months. Adversaries can use victim organization's compute power and steal valuable information. The researchers estimate the value of the compromised machines to be nearly 1 billion USD.

Five vulnerabilities in Ray were reported to Anyscale, the maintainers of Ray. Anyscale promptly fixed four of the five vulnerabilities. However, the fifth vulnerability CVE-2023-48022 remains disputed. Anyscale maintains that Ray's lack of authentication is a design decision, and that Ray is meant to be deployed in a safe network environment. The Oligo researchers deem this a "shadow vulnerability" because in disputed status, the CVE does not show up in static scans.

References

Source: MITRE ATLAS case studies, used under Apache 2.0.