/

CVE-2026-41486

Severity:

HIGH RISK

(8.8)

Arbitrary Code Execution via Unsafe Deserialization

CVE-2026-41486

Analyzed

Vulnerability type

Category:

Arbitrary Code Execution via Unsafe Deserialization

CWE:

CWE-94, CWE-502

Impact:

Remote Code Execution during Parquet Schema Parsing

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Ray Data globally registers custom Arrow extension types that deserialize untrusted Parquet metadata using cloudpickle during schema parsing.

An attacker who can influence Parquet files processed by Ray can trigger arbitrary code execution when PyArrow loads these extension types, even before any row data is read.

Affected context

This vulnerability occurs in Ray deployments using Ray Data between versions 2.54.0 and before 2.55.0 where:

  • PyArrow is used to read Parquet files, and
  • The custom Ray Arrow extension types (ray.data.arrow_tensor, ray.data.arrow_tensor_v2, ray.data.arrow_variable_shaped_tensor) may be present in the file schema.

The risk materializes when Ray reads Parquet files whose metadata can be controlled or influenced by an attacker, such as from shared object storage, user-uploaded datasets, or loosely controlled data pipelines.

Exploit preconditions

  • Attack surface: Parquet files ingested by Ray Data (e.g., from object stores like S3, shared file systems, or user-supplied data locations).
  • Required access: Ability to create or modify Parquet files with Ray's custom Arrow extension type metadata in a location that Ray Data will read.
  • Trigger point: Loading a Parquet file that includes the registered Ray Arrow extension types, causing PyArrow to invoke __arrow_ext_deserialize__ during schema parsing.
  • Why exploitation is possible: The extension deserialization path passes raw metadata bytes directly into cloudpickle.loads() without validation or restriction, allowing attacker-controlled serialized Python objects to be executed as code.

Why this happens

The core issue is an unsafe deserialization pattern where untrusted metadata is treated as executable code.

Ray Data registers custom Arrow extension types globally in PyArrow, and the corresponding __arrow_ext_deserialize__ implementation feeds the extension's metadata bytes directly into cloudpickle.loads(). Cloudpickle is a powerful, code-executing deserializer not intended for untrusted input.

This maps to:

  • CWE-94: Improper Control of Generation of Code, because attacker-supplied data can influence code execution through deserialized objects.
  • CWE-502: Deserialization of Untrusted Data, because schema metadata from Parquet files is deserialized without validation, sandboxing, or trust boundaries.

The design assumption that Arrow extension metadata is trusted breaks down in environments where data can be supplied or modified by external parties.

Potential impact

  • Arbitrary code execution in the Ray worker or driver process reading the Parquet file
  • Full compromise of the Ray job environment, including access to credentials and environment variables
  • Unauthorized access to connected data sources or downstream systems reachable from the compromised process
  • Lateral movement within the AI compute cluster or underlying infrastructure
  • Tampering with training, inference, or data processing pipelines, potentially poisoning AI models or outputs

General mitigation guidance

Risk reduction focuses on treating all serialized metadata as untrusted and avoiding powerful deserializers on such data paths.

Recommended patterns include:

  • Avoid unsafe deserializers: Do not use generic, code-executing mechanisms like cloudpickle.loads() on data that may originate outside a tightly controlled trust boundary.
  • Constrain extension deserialization: Implement Arrow extension types such that __arrow_ext_deserialize__ uses fixed, declarative schemas or simple structured formats (e.g., JSON, msgpack) with explicit parsing rather than arbitrary object graphs.
  • Enforce trust boundaries on data sources: Restrict which Parquet files Ray Data is allowed to load (private buckets, controlled prefixes, authenticated uploads) and separate trusted internal datasets from user-supplied data.
  • Use least privilege for Ray workloads: Run Ray workers with minimal system and network privileges, isolating them with containers, namespaces, and restrictive IAM roles so that a compromise has limited blast radius.
  • Introduce defensive validation: Where feasible, validate Parquet schemas and extension metadata against an expected allowlist (e.g., only known-safe extension types and fields) before allowing deserialization logic to run.
  • Apply secure-by-default configuration: Disable or tightly gate use of custom extension types in contexts that handle arbitrary user data, favoring simpler, standard Arrow types unless the environment is fully trusted.

How teams detect issues like this

Detection approaches should center on finding unsafe deserialization flows and unusual use of code-executing serializers:

  • Static analysis: Configure rules to flag calls to cloudpickle.loads() and similar APIs, especially when their inputs originate from I/O layers (file reads, network, object storage, or Arrow/Parquet metadata).
  • Code review signals: During review, pay special attention to Arrow extension type implementations, deserialization hooks, and any schema/metadata handling code that invokes powerful serialization libraries.
  • Policy enforcement: Establish internal guidelines that prohibit using cloudpickle or equivalent mechanisms on data that might be influenced by external actors, and enforce these with pre-commit hooks or CI checks.
  • Runtime monitoring: Monitor Ray workloads for suspicious behavior when loading Parquet files, such as unexpected network connections, process spawns, or filesystem writes correlated with schema parsing stages.
  • Automated scanning: Use SAST/IAST tools and custom linters to automatically surface insecure deserialization patterns in Python code, including in data loader and connector modules.

Sources

SourceLink
github.comgithub.com/ray-project/ray/commit/c02bd31ae31996805868baa446a131a8d304525f
github.comgithub.com/ray-project/ray/pull/62056
github.comgithub.com/ray-project/ray/releases/tag/ray-2.55.0
github.comgithub.com/ray-project/ray/security/advisories/GHSA-mw35-8rx3-xf9r

Frequently asked

questions

It can be, depending on how Ray Data is deployed. If an attacker can cause Ray to read a Parquet file they control—for example via user uploads, shared object storage, or compromised upstream pipelines—they can potentially achieve remote code execution when the file is parsed.

The attacker needs the ability to create or modify Parquet files that will be read by a vulnerable Ray Data deployment. They do not need shell access to the Ray nodes; control over the file contents and location in the data pipeline is the key requirement.

The safest pattern is to eliminate the use of powerful, code-executing deserializers like cloudpickle.loads() on any data that may be influenced by external sources. Replace this with explicit, structured parsing of extension metadata, using fixed schemas and simple data formats, and ensure that Arrow extension hooks never execute arbitrary code based on unvalidated input.

Treat all incoming data—especially schemas and metadata—as untrusted. Avoid generic object deserialization for untrusted inputs, implement strict trust boundaries for data sources, enforce least privilege for processing workloads, and institutionalize reviews and automated checks focused on serialization/deserialization code paths in your data and ML infrastructure.

Find out what's already
exploitable in your codebase.