CVE-2026-57516: Ray Package Unsafe Deserialization Vulnerability Leading to Remote Code Execution
Summary
CVE-2026-57516: 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. Affects ray versions < 2.56.0. Fixed in 2.56.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Ray is an open-source framework designed for building and running distributed applications. It provides a simple interface for parallel and distributed computing, enabling developers to scale their applications seamlessly. However, Ray versions prior to 2.56.0 are vulnerable to an unsafe deserialization issue within the WebDataset reader, which can be exploited by attackers.
Vulnerability Detail
The vulnerability arises from the WebDataset reader in Ray, where 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. This behavior allows attackers to craft a malicious tar archive that, when processed by the read_webdataset() function, can execute arbitrary code within Ray remote workers. The implications of this vulnerability are severe, as it can lead to remote code execution, potentially compromising the entire system running the affected Ray instance.
How To Fix
Latest published version: 2.59.0 as of 23 Oct 2026
pip install --upgrade "ray==2.59.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
2.56.0
This is the first release that contains the fix.
pip install --upgrade "ray==2.56.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, avoid using the WebDataset reader with untrusted tar archives. Ensure that any tar files processed by the read_webdataset() function are from trusted sources to mitigate the risk of exploitation until the package is updated.
Conclusion
The CVE-2026-57516 vulnerability in the Ray package poses a significant risk due to unsafe deserialization that can lead to remote code execution. Users are strongly advised to update to version 2.56.0 or later to mitigate this risk. Additionally, employing temporary workarounds and utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.
See every vulnerability recorded for ray →
FAQ
CVE-2026-57516 is a vulnerability in the Ray package that allows for remote code execution due to unsafe deserialization in the WebDataset reader.
Ray versions prior to 2.56.0 are affected by this vulnerability.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Check your application's vulnerability status using the Vulert playground at Vulert Scanner.
If you cannot update Ray immediately, avoid using the WebDataset reader with untrusted tar archives as a temporary workaround.
Failing to address this vulnerability can lead to remote code execution, allowing attackers to execute arbitrary code on your system, which may result in data breaches or system compromise.
Related vulnerabilities
Recent vulnerabilities recorded for ray.