Ray: Arbitrary code execution via ray.data.read_webdataset default decoder: pickle.loads(value) and torch.load(weights_only=False)
CVE-2026-57516 · GHSA-hhrp-gw25-jr43 · published 2026-07-24
- Severity
- High
- CVSS score
- 8.8
- Chance of exploitation (EPSS)
- 1.1%
- Fixed in
- 2.56.0
- Exploitation Public proof of concept
- Automatable No
- Technical impact Total
- CISA SSVC
ray.data.readwebdataset(paths=...) is a @PublicAPI(stability="alpha") reader for WebDataset-format TAR files. Its default decoder=True invokes defaultdecoder 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 -> 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 readwebdataset) achieves arbitrary code execution in the calling Ray process at schema-sample time, before row data is consumed.
Upgrade ray to 2.56.0 or later.
Two minimal options, both Ray-internal: 1. Make the unsafe extensions opt-in, mirroring the GHSA-mw35 fix pattern. Replace the .pt/.pth and .pkl/.pickle branches with a guard: 2. Drop these branches from the default decoder entirely and require callers to provide their own decoder when working with .pkl/.pt samples. This is the safer default, matches WebDataset upstream's guidance ("by default, use safe decoders"), and is consistent with the spirit of the GHSA-mw35 patch. Either option flips the default-on RCE primitive into an explicit opt-in.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| ray | PyPI | < 2.56.0 | 2.56.0 |
- CriticalUnauthenticated Remote Code Execution in Langflow via Public Flow Build EndpointlangflowExploited
- CriticalLangflow Unauth RCElangflow, langflow-baseExploited
- HighLiteLLM: Authenticated command execution via MCP stdio test endpointslitellmExploited
- CriticalMLflow vulnerable to remote code execution on unauthenticated servers via third-party scorer deserialization importing caller-placed artifacmlflow
- CriticalAgno: Arbitrary code execution via `eval()` on `field_type` in `FunctionCall`agno
- CriticalStorybook: Missing origin validation in Storybook preview allows code injection from malicious websites@storybook/addon-mcp, @storybook/addon-mcp
- CriticalRay is vulnerable to Critical RCE via Safari & Firefox Browsers through DNS Rebinding AttackrayExploited
- CriticalRay's New Token Authentication is Disabled By Defaultray
- CriticalRay has arbitrary code execution via jobs submission APIray
- CriticalRay Path Traversal vulnerabilityray
- CriticalRay Missing Authorization vulnerabilityray
- CriticalRay OS Command Injection vulnerabilityray
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.