CVE-2026-57516: Ray: Arbitrary code execution via ray.data.read_webdataset default decoder: pickle.loads(value) and torch.load(weights_only=False)
ray.data.read_webdataset(paths=...) is a @PublicAPI(stability="alpha")
reader for WebDataset-format TAR files. Its default decoder=True invokes
_default_decoder on every sample’s keys, which routes file extension to a
decoder by extension. Two of those branches deserialize attacker-controlled
bytes with no validation:
.pickle/.pkl->pickle.loads(value).pt/.pth->torch.load(io.BytesIO(value), weights_only=False)
Both fire during a standard ray.data.read_webdataset(...).take_all() /
.iter_batches() call. No flags, no opt-in, no environment variable.
An attacker who can supply a TAR (via S3 share, HuggingFace Hub mirror,
email attachment, model-zoo, or any HTTP URL the user passes to
read_webdataset) achieves arbitrary code execution in the calling
Ray process at schema-sample time, before row data is consumed.
This is the same class of bug as GHSA-mw35-8rx3-xf9r (Parquet Arrow
Extension Type cloudpickle deserialization, patched in 2.55.0): standard
data-loading API, attacker-controlled file format, deserialization gadget
invoked transparently. The 2.55.0 patch addressed
tensor_extensions/arrow.py:_deserialize_with_fallback and made cloudpickle
opt-in via RAY_DATA_AUTOLOAD_CLOUDPICKLE_TENSOR_METADATA=1. The
WebDataset path is a different code site and was not touched.
References
- github.com/advisories/GHSA-hhrp-gw25-jr43
- github.com/pypa/advisory-database/tree/main/vulns/ray/PYSEC-2026-2273.yaml
- github.com/ray-project/ray/commit/41443a18f9e6403a072de69098a279c23e2d943c
- github.com/ray-project/ray/pull/63469
- github.com/ray-project/ray/pull/63470
- github.com/ray-project/ray/releases/tag/ray-2.56.0
- github.com/ray-project/ray/security/advisories/GHSA-hhrp-gw25-jr43
- nvd.nist.gov/vuln/detail/CVE-2026-57516
- www.vulncheck.com/advisories/ray-unsafe-deserialization-rce-via-webdataset-reader
Code Behaviors & Features
Detect and mitigate CVE-2026-57516 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →