CONTENTUM.COMA specialist. A plan. A result.

Vulnerabilities · 2026

CVE-2026-41486
PyPI vulnerability

# Remote Code Execution via Parquet Arrow Extension Type Deserialization ## Summary Ray Data registers custom Arrow extension types (`ray.data.arrow_tensor`, `ray.data.arrow_tensor_v2`, `ray.data.arrow_variable_shaped_tensor`) globally in PyArrow. When PyArrow reads a Parquet file containing one of these extension types, it calls `__arrow_ext_deserialize__` on the field's metadata bytes. Ray's implementation passes these bytes directly to `cloudpickle.loads()`, achieving arbitrary code execution during schema parsing, before any row data is read. In May 2024, Ray fixed a related vulnerability in `PyExtensionType`-based extension types ([issue #41314](https://github.com/ray-project/ray/issues/41314), [PR #45084](https://github.com/ray-project/ray/pull/45084)). In July 2025, [PR #54831](https://github.com/ray-project/ray/pull/54831) introduced `cloudpickle.loads()` into the replacement extension types' deserialization path, reintroducing the same class of vulnerability. Note: Source links in this report are pinned to the Ray 2.54.0 release commit (`48bd1f8fa4`) for stable line references. We also re-verified the same vulnerable code paths on current `master` as of March 17, 2026. ## Details ### Extension type registration Ray Data registers three Arrow extension types globally in PyArrow: ```python # python/ray/data/_internal/tensor_extensions/arrow.py:1603-1605 pa.register_extension_type(ArrowTensorType((0,), pa.int64())) pa.register_extension_type(ArrowTensorTypeV2((0,), pa.int64())) pa.register_extension_type(ArrowVariableShapedTensorType(pa.int64(), 0)) ``` Registration happens at module load time ([`__init__.py:94-95`](https://github.com/ray-project/ray/blob/48bd1f8fa4/python/ray/data/__init__.py#L94-L95)), and any use of `ray.data` triggers it. Once registered, PyArrow automatically calls `__arrow_ext_deserialize__` whenever it encounters these extension type names in any Parquet file's schema, including files from untrusted sources. ### The code path to `cloudpickle.loads()` All three extension types inherit from `ArrowExtensionSerializeDeserializeCache`, whose `__arrow_ext_deserialize__` method ([`arrow.py:176-179`](https://github.com/ray-project/ray/blob/48bd1f8fa4/python/ray/data/_internal/tensor_extensions/arrow.py#L176-L179)) delegates to subclass methods that ultimately call `_deserialize_with_fallback()`: ```python # python/ray/data/_internal/tensor_extensions/arrow.py:84-96 def _deserialize_with_fallback(serialized: bytes, field_name: str = "data"): """Deserialize data with cloudpickle first, fallback to JSON.""" try: # Try cloudpickle first (new format) return cloudpickle.loads(serialized) # <-- arbitrary code execution except Exception: # Fallback to JSON format (legacy) try: return json.loads(serialized) except json.JSONDecodeError: raise ValueError( f"Unable to deserialize {field_name} from {type(serialized)}" ) ``` The `serialized` bytes come directly from the Parquet file's field-level metadata (`ARROW:extension:metadata`) with no validation. `cloudpickle.loads()` is tried **first**, meaning a crafted payload will always be executed before the safe JSON fallback is reached. For `ArrowTensorType`, the call chain is: ``` __arrow_ext_deserialize__(cls, storage_type, serialized) # arrow.py:176 -> _arrow_ext_deserialize_cache(serialized, value_type) # arrow.py:178 -> _arrow_ext_deserialize_compute(serialized, value_type) # arrow.py:652 -> _deserialize_with_fallback(serialized, "shape") # arrow.py:653 -> cloudpickle.loads(serialized) # arrow.py:88 RCE ``` `ArrowTensorTypeV2` ([`arrow.py:679-680`](https://github.com/ray-project/ray/blob/48bd1f8fa4/python/ray/data/_internal/tensor_extensions/arrow.py#L679-L680)) and `ArrowVariableShapedTensorType` ([`arrow.py:1076-1077`](https://github.com/ray-project/ray/blob/48bd1f8fa4/python/ray/data/_internal/tensor_extensions/arrow.py#L1076-L1077)) follow the same pattern. ### Why the existing mitigation doesn't help After issue [#41314](https://github.com/ray-project/ray/issue

Affected products

PyPI. The exact versions are in the references.

What to do now

  • Check your exposureFind out whether PyPI runs anywhere in your environment, including systems of suppliers.
  • UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
  • Set the orderSystems that can be reached from the internet come first, then the rest.

References

Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.