PyPI: ray
CVE-2023-48022
Safety vulnerability ID: SFTY-20231128-12091
Safety legacy ID: pyup.io-65189
*DISPUTED* Ray allows a remote attacker to execute arbitrary code via the job submission API. In the default configuration, Ray does not enforce authentication. As a result, attackers may freely submit jobs, delete existing jobs, retrieve sensitive information, and exploit the other vulnerabilities described in this advisory. While the Ray documentation included an optional mutual TLS authentication mode, Ray does not appear to support an authorization model. In other words, even if a Ray administrator explicitly enabled TLS authentication, they would be unable to grant users different permissions, such as read-only access to the Ray Dashboard. The most direct method of exploitation discovered is to submit arbitrary operating system commands for execution via the job submission API using a raw HTTP request or the Ray Jobs Python SDK. These do not require authentication in the default configuration, and are accessible remotely to any system with access to the Ray Dashboard (TCP port 8265 by default). NOTE: The vendor's position is that this report is irrelevant because Ray, as stated in its documentation, is not intended for use outside of a strictly controlled network environment. NOTE2: This flaw has been under active exploitation in the wild and it was baptized 'ShadowRay'.
Overview
Ray has arbitrary code execution via jobs submission API
Advisory
*DISPUTED* Ray allows a remote attacker to execute arbitrary code via the job submission API. In the default configuration, Ray does not enforce authentication. As a result, attackers may freely submit jobs, delete existing jobs, retrieve sensitive information, and exploit the other vulnerabilities described in this advisory. While the Ray documentation included an optional mutual TLS authentication mode, Ray does not appear to support an authorization model. In other words, even if a Ray administrator explicitly enabled TLS authentication, they would be unable to grant users different permissions, such as read-only access to the Ray Dashboard. The most direct method of exploitation discovered is to submit arbitrary operating system commands for execution via the job submission API using a raw HTTP request or the Ray Jobs Python SDK. These do not require authentication in the default configuration, and are accessible remotely to any system with access to the Ray Dashboard (TCP port 8265 by default). NOTE: The vendor's position is that this report is irrelevant because Ray, as stated in its documentation, is not intended for use outside of a strictly controlled network environment. NOTE2: This flaw has been under active exploitation in the wild and it was baptized 'ShadowRay'.
How to Fix
We recommend updating ray to the latest non-vulnerable version.
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20231128-12091/CVE-2023-48022
- https://nvd.nist.gov/vuln/detail/CVE-2023-48022
- https://bishopfox.com/blog/ray-versions-2-6-3-2-8-0
- https://docs.ray.io/en/latest/ray-security/index.html
- https://www.vicarius.io/vsociety/posts/shadowray-cve-2023-48022-exploit
- https://atlas.mitre.org/studies/AML.CS0023
- https://github.com/ray-project/ray/commit/978947083b1e192dba61ef653c863b11d56b0936
- https://console.vulncheck.com/cve/CVE-2023-48022
- https://github.com/advisories/GHSA-xg2h-7cxj-3gvh
- https://github.com/honysyang/Ray
- https://www.anyscale.com/blog/update-on-ray-cve-2023-48022-new-verification-tooling-available
- https://www.oligo.security/blog/shadowray-attack-ai-workloads-actively-exploited-in-the-wild
- https://www.vulncheck.com/blog/initial-access-intelligence-august-2024
- https://docs.ray.io/en/latest/ray-security/token-auth.html
- https://www.vicarius.io/vsociety/posts/the-story-of-shadowray-cve-2023-48022
- https://github.com/pypa/advisory-database/tree/main/vulns/ray/PYSEC-2026-517.yaml
- https://pypi.org/project/ray
- https://github.com/advisories/GHSA-6wgj-66m2-xxp2
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
