NewN-Day-BenchView benchmark
winfunc
Back to Hacktivity

Status: Patched

This vulnerability has been verified as resolved and deployed.

Ray logo
RayCritical2026-08-05

Unauthenticated Serve replica gRPC requests allow arbitrary code execution

Summary

Every Python Serve replica exposed an unauthenticated pickle sink on an ephemeral node port

A network caller could invoke an internal Serve replica gRPC method without the configured Ray token and place a Python pickle reduction in pickled_request_metadata, causing arbitrary code execution in the replica process before normal request dispatch.

Root cause. Replica.__init__ created ASGIService with raw grpc.aio.server() and _on_initialized bound it through add_insecure_port("[::]:0"). The shared token interceptor and TLS helper were skipped, while _wrap_grpc_call performed pickle.loads() as its first operation.

Remediation evidence. Ray opened exact PR #65189 after the disclosure and merged it on 5 August 2026. The patch moves both server and client sides to Ray's shared authenticated/TLS-aware gRPC helpers and adds token-mode coverage.

CVSS Score

VectorN
ComplexityL
PrivilegesN
User InteractionN
ScopeU
ConfidentialityH
IntegrityH
AvailabilityH
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Vulnerability Location

SourceLine 525
src/ray/protobuf/serve.proto
ASGIRequest.pickled_request_metadata
SinkLine 248
python/ray/serve/_private/replica.py
_wrap_grpc_call.wrapper()

Source-to-Sink Analysis

1
python/ray/serve/_private/replica.py:Replica.__init__()

Each initialized Python Serve replica created a raw asynchronous gRPC server outside Ray's authentication factory.

PYTHON
self._server = grpc.aio.server(options=grpc_options)
2
python/ray/serve/_private/replica.py:_on_initialized()

The internal service was exposed on an all-interface ephemeral port without TLS or token interception.

PYTHON
port = self._server.add_insecure_port("[::]:0")
await self._server.start()
3
python/ray/serve/_private/replica.py:248

Any registered ASGI RPC reached an unconditional deserialization sink before admission control or user-code dispatch.

PYTHON
request_metadata = pickle.loads(request.pickled_request_metadata)

Impact Analysis

Critical Impact

The attacker obtains arbitrary Python/process execution in an existing Serve replica despite token authentication. That process authority can expose inherited secrets, files, cloud identity, application state, and network access, and can tamper with or terminate the service.

Attack Surface

Ephemeral ray.serve.ASGIService gRPC ports reachable on Ray cluster or VPN node networks when a Python Serve replica is initialized.

Preconditions

The attacker needs TCP reachability to a Ray node and the replica's discoverable ephemeral port. The documented token mode may be enabled; no valid token, deployment handle, or victim interaction is required.

Proof of Concept

Environment Setup

Use an isolated Ray cluster on the vulnerable revision with RAY_AUTH_MODE=token and deploy one harmless Python Serve replica.

Target Configuration

Allow the test client to reach node ephemeral ports, but do not provide it the Ray authentication token.

Exploit Delivery

Discover the ASGIService port and send one protobuf request whose pickled_request_metadata contains a harmless proof reduction, such as writing a marker in the disposable container.

Outcome

PR #65189 attaches Ray's asynchronous authentication interceptor and uses the corresponding client/channel helper, so the same unauthenticated request is rejected before deserialization.

Expected Response: The marker appears in the replica before request metadata validation; missing or invalid authorization metadata does not block the RPC.

Run this level of analysis on your repo.

Winfunc traces source-to-sink paths, validates exploitability, and gives your team patch-ready remediation.

Vulnerability Detection