Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. ray
  4. ›
  5. CVE-2026-57516

CVE-2026-57516: Ray: Arbitrary code execution via ray.data.read_webdataset default decoder: pickle.loads(value) and torch.load(weights_only=False)

July 24, 2026

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 →

Affected versions

All versions before 2.56.0

Fixed versions

  • 2.56.0

Solution

Upgrade to version 2.56.0 or above.

Impact 8.8 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-502: Deserialization of Untrusted Data
  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

pypi/ray/CVE-2026-57516.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:17:24 +0000.