PYSEC-2026-2273: Ray < 2.56.0 Unsafe Deserialization RCE via WebDataset Reader
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 readwebdataset() function. The defaultdecoder() function in webdatasetdatasource.py unconditionally calls pickle.loads() on tar entries with .pkl/.pickle extensions and torch.load() with weightsonly=False on .pt/.pth entries, executing arbitrary code inside Ray remote workers on every worker that processes the malicious archive.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Ray deployments are exposed when they use read_webdataset() to process tar archives that an attacker can supply or modify. Code execution occurs in each Ray remote worker that processes the malicious archive.
What must an attacker provide to trigger execution?
The attacker needs a malicious tar archive that is passed to read_webdataset(). Entries ending in .pkl or .pickle are deserialized with pickle.loads(), while .pt and .pth entries are loaded with torch.load() with weights_only=False.
Is a non-default decoder configuration required for exploitation?
No. The affected _default_decoder() unconditionally uses the unsafe loading behavior for the listed file extensions, so archives handled by the default decoder are affected.
What should be done if patching cannot happen immediately?
Do not process untrusted or attacker-modifiable WebDataset tar archives with read_webdataset(). Restrict accepted archive contents so they cannot include .pkl, .pickle, .pt, or .pth entries.
Which Ray release addresses the issue?
Upgrade to Ray 2.56.0 or later. The affected versions are Ray releases prior to 2.56.0.