Skip to main content

What Is Ray? Distributed Python on GPU Clusters, ShadowRay and Token Authentication


For executives​

Ray is an open-source framework for running Python code across a cluster of machines, widely used for distributed training, batch inference, model serving and reinforcement learning on GPUs. Its design goal is to make submitting code to a cluster easy, and for most of its history it did that without any authentication: anyone who could reach a Ray dashboard could run code on every node behind it. Attackers noticed. Oligo Security reported mass exploitation of exposed Ray clusters in March 2024 (ShadowRay) and a self-propagating botnet against more than 230,000 exposed Ray servers in November 2025 (ShadowRay 2.0). In November 2026, Elastic Security Labs documented an attacker using an unauthenticated Ray job agent to plant miners on GPU hosts and hide them behind a fake GPU monitoring library. Ray added token authentication in late 2025, but it is off unless you turn it on.

What Ray is​

Ray, maintained by Anyscale, has a core runtime and libraries on top:

  • Ray Core: tasks and actors, Python functions and classes that run anywhere in the cluster, with GPU scheduling.
  • Ray Train and Ray Tune: distributed training and hyperparameter search.
  • Ray Data: distributed data loading and preprocessing.
  • Ray Serve: model serving.

A Ray cluster has a head node, which runs the Global Control Store (default port 6379) and the dashboard with its Jobs API (default port 8265), and worker nodes that run the work. On Kubernetes, KubeRay manages clusters.

Why Ray is a target​

Running code is the feature​

The Jobs API exists to accept code and run it on the cluster. Without authentication in front of it, that is remote code execution for anyone on the network. The issue was filed as CVE-2023-48022; Ray's maintainers dispute it as intended behavior for a trusted network, so it was never patched as a bug. Its disclosure history, exploitation timeline and attack chain are covered in the CVE-2023-48022 article linked below.

Clusters hold GPUs, data and credentials​

A Ray cluster typically has GPUs, access to training data and model storage, and cloud credentials for scaling. Compromising the head node reaches all of it, and Ray's own scheduling spreads an attacker's code across every worker.

Exposure is widespread​

Oligo's ShadowRay 2.0 research (November 18, 2025) found more than 230,000 Ray servers exposed to the internet, up from a few thousand at the first discovery, and an attacker it tracks as IronErn440 using Ray's own orchestration to spread a cryptomining and denial-of-service botnet from cluster to cluster (Oligo Security). Stealthium has reproduced the cryptomining route: a job submitted through an open Jobs API ends with GPUs mining cryptocurrency.

The dashboard is not the only door​

In the intrusion Elastic Security Labs tracks as REF3364, the Ray dashboard on the head node listened only on loopback, which is the usual hardening advice. The job agent, which also accepts job submissions, was reachable from the internet without authentication (Elastic Security Labs, November 12, 2026). The attacker probed it on October 22, 2026, submitted a job on October 24 that ran nvidia-smi and sent the GPU inventory out, and on October 25 submitted a Python reverse shell running as the account that owned the Ray session. From there the attacker added an SSH key, gained root on three GPU hosts and installed SANSAR, a Tor-controlled miner orchestrator, with a replacement NVML library that reports the GPUs as idle and a kernel rootkit that hides the miners.

Even local clusters can be reached​

CVE-2025-62593 showed that a Ray dashboard on a developer's own machine was reachable from a malicious web page. Ray blocked browser requests by checking the User-Agent header, which some browsers let scripts change; combined with DNS rebinding, a web page could submit jobs to localhost:8265 and run commands. Ray 2.52.0 replaced the check with browser-origin controls. CISA added the CVE to its Known Exploited Vulnerabilities catalog on August 17, 2026 (Anyscale).

Token authentication​

Ray 2.52.0 (November 2025) introduced built-in token authentication for the dashboard, Jobs API and internal RPC, enabled by setting RAY_AUTH_MODE=token (Anyscale). It is not the default: Ray's documentation lists disabled as the default mode, and the insecure default was itself assigned CVE-2025-34351. Anyscale has said it is working toward making token authentication the default. A value other than token, including a typo, leaves authentication off.

Detection​

  • Exposure: know every Ray dashboard and GCS port on your networks and who can reach them; anything bound to 0.0.0.0 without token authentication is open.
  • Job submissions: jobs submitted from unexpected sources or with entrypoints that download and run scripts. A first job that only runs nvidia-smi and sends the output off the host is reconnaissance.
  • Node integrity: changes to NVML and other NVIDIA user-space libraries, new kernel modules and new SSH keys on Ray nodes. GPU utilization reported through a tampered NVML library cannot be trusted.
  • Behavior on nodes: Ray worker processes starting shells, miners or network scanners, or using GPUs no scheduled job accounts for; outbound connections to mining pools or code-hosting sites.
  • Attribution: tying GPU usage on each node to a Ray job and submitter is what separates an attacker's job from a researcher's.

Securing Ray​

  • Run Ray 2.52.0 or later and set RAY_AUTH_MODE=token on every node; on Kubernetes, use KubeRay's token support.
  • Keep dashboards, job agents and GCS ports on private networks; never bind them to public interfaces. Restricting the dashboard alone leaves the job agent open.
  • Check images, Helm charts and notebooks for old Ray versions and --dashboard-host=0.0.0.0.
  • Scope the cloud credentials Ray clusters hold.