HIGH 8.8

CVE-2026-57516: Ray WebDataset Remote Code Execution via Unsafe Deserialization

Ray versions before 2.56.0 contain a critical vulnerability in how they process web dataset files. When using the read_webdataset() function, Ray automatically unpacks and deserializes certain file types (pickle and PyTorch model files) from tar archives without validation. An attacker can craft a malicious archive containing specially crafted .pkl, .pickle, .pt, or .pth files that execute arbitrary code when processed. Because Ray distributes this work across remote workers, the malicious code runs on every worker that touches the archive, potentially compromising your entire distributed computing cluster.

Source data · NVD / CISA · public domain

CVSS
3.1 · 8.8 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-502
Affected products
1 configuration(s)
Published / Modified
2026-07-01 / 2026-07-14

NVD description (verbatim)

Ray prior to 2.56.0 contains an unsafe deserialization vulnerability in the WebDataset reader that allows attackers to achieve remote code execution by supplying a malicious tar archive to the read_webdataset() function. The _default_decoder() function in webdataset_datasource.py unconditionally calls pickle.loads() on tar entries with .pkl/.pickle extensions and torch.load() with weights_only=False on .pt/.pth entries, executing arbitrary code inside Ray remote workers on every worker that processes the malicious archive.

6 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from unsafe deserialization in the WebDataset reader component (webdataset_datasource.py). The _default_decoder() function unconditionally calls pickle.loads() on files matching .pkl and .pickle extensions, and torch.load() with weights_only=False on .pt and .pth files. Neither deserialization operation validates or sanitizes the data before execution. Because pickle and PyTorch's load function with weights_only=False can instantiate arbitrary Python objects during deserialization, an attacker-controlled archive effectively becomes a vehicle for remote code execution. Ray's distributed nature means the exploit payload executes in the context of every worker process that reads the malicious archive, multiplying the attack surface and impact.

Business impact

Compromise of Ray clusters can lead to complete loss of confidentiality, integrity, and availability of distributed workloads. An attacker gaining code execution across worker nodes can steal training data, model parameters, or intermediate computation results; inject false data or poisoned models; disrupt batch processing, machine learning pipelines, or real-time inference; or pivot to other systems on your network. Organizations running Ray for ML training, data processing, or analytics face potential data theft, IP loss, operational downtime, and regulatory compliance violations if sensitive data is involved.

Affected systems

All Ray installations prior to version 2.56.0 are affected. The vulnerability is triggered specifically when the read_webdataset() function is called with untrusted tar archives. Any deployment using Ray's WebDataset reader for local or remote dataset ingestion is at risk. This includes ML training pipelines, batch data processing workflows, and any distributed application that accepts external tar-based datasets.

Exploitability

Exploitation requires user interaction in the sense that the vulnerable read_webdataset() function must be invoked with an attacker-supplied archive. However, the barrier to entry is low: an attacker need only craft a tar file containing a malicious pickle or PyTorch file and make it available to the target (via download, API upload, or network share). No special privileges, authentication, or complex setup is required. The CVSS vector reflects network accessibility, low complexity, and no privileges needed. If datasets are sourced from untrusted or insufficiently validated sources, exploitation is straightforward.

Remediation

Upgrade Ray to version 2.56.0 or later immediately. This version patches the unsafe deserialization by implementing proper validation and secure deserialization practices for WebDataset entries. Verify the upgrade is complete across all worker nodes and driver processes in your cluster. In addition, implement network segmentation and access controls to limit which sources can supply datasets to Ray, and validate the integrity and origin of tar archives before processing.

Patch guidance

Apply Ray 2.56.0 as soon as testing permits. Verify that all Ray processes—both drivers and workers—are running the patched version by checking version output and restarting the cluster if necessary. Test your existing WebDataset workflows after upgrade to ensure compatibility. If you are on a version prior to 2.56.0, prioritize this upgrade in your maintenance window; there is no known workaround beyond upgrading or disabling WebDataset functionality.

Detection guidance

Monitor Ray worker logs and system execution traces for unexpected pickle or torch.load() deserialization of external tar entries. Look for process spawns or system calls from Ray worker processes that do not align with your normal workload patterns. Network-based detection is limited; focus on host-level anomaly detection around Ray worker processes. Query your dataset provenance and access logs to identify whether untrusted or external tar archives have been supplied to read_webdataset(). Implement file integrity monitoring on stored datasets to detect tampering.

Why prioritize this

This vulnerability scores 8.8 (HIGH) due to network-accessible attack vector, no authentication requirement, and severe impact (arbitrary code execution on every worker). Although exploitation requires dataset supply (not purely unauthenticated network attack), the combination of ease of exploitation, cluster-wide impact, and high likelihood of data/IP loss makes this a top-tier priority. Any organization running Ray in production should treat this as critical.

Risk score, explained

CVSS 8.8 reflects: (1) Network vector—datasets can be supplied remotely; (2) Low complexity—no advanced exploitation technique needed, just a crafted tar file; (3) No privileges or user interaction paradoxically rated; (4) High confidentiality, integrity, and availability impact—code execution on workers leads to data theft, system compromise, and service disruption. The score appropriately signals severe risk for Ray deployments that accept external datasets.

Frequently asked questions

Can we use Ray safely if we only process internal, trusted datasets?

Partially. If your datasets come exclusively from verified internal sources and you have strong access controls preventing external input, your risk is reduced but not eliminated. However, supply chain compromise or insider threats could still deliver malicious archives. The safest approach is to upgrade. If upgrade is delayed, implement strict dataset validation and network segmentation.

Does this affect Ray installations that do not use WebDataset?

No. The vulnerability is specific to the WebDataset reader and the read_webdataset() function. If your Ray cluster does not call this function, you are not directly affected by this vulnerability. However, verify your codebase and dependencies to ensure WebDataset is not used indirectly.

What happens if we disable WebDataset functionality temporarily?

Disabling or removing WebDataset reader usage eliminates the attack surface for this specific vulnerability. This can be a short-term mitigation if upgrade is delayed, but it blocks your WebDataset workflows. Upgrade to 2.56.0 is the proper remediation.

Are there any indicators we can search for in our logs to find past exploitation?

Search Ray worker logs for deserialization errors, unexpected pickle/torch operations on external files, or process creation anomalies during dataset reads. Check system audit logs for unexpected child processes spawned from Ray workers. Review dataset access logs for ingestion of tar archives from unexpected sources. However, absence of alerts does not guarantee non-exploitation; if you suspect compromise, engage your security team for forensic analysis.

This analysis is based on the official CVE record and vendor advisories current as of the publication date. Verify all patch versions and applicability against your specific Ray deployment and the official Anyscale security advisories. This explainer is for informational purposes and does not constitute legal advice or a guarantee of security. Organizations should conduct their own risk assessment and testing before deploying patches in production. SEC.co makes no warranty regarding the completeness or accuracy of this analysis beyond the ground-truth data provided. Source: NVD (public-domain), retrieved 2026-08-10. Analysis generated by SEC.co (claude-haiku-4-5).