/

CVE-2026-25874

Severity:

CRITICAL RISK

(9.8)

Unsafe Deserialization in LeRobot Async Inference gRPC

CVE-2026-25874

Analyzed

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.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

LeRobot up to version 0.5.1 uses Python's pickle.loads() to deserialize data received over unauthenticated, non‑TLS gRPC channels in the policy server and robot client components.

An unauthenticated attacker on the network can send crafted pickle payloads through several gRPC calls to achieve arbitrary code execution on either the server or the client.

Affected context

The vulnerability appears in LeRobot deployments that use the async inference pipeline where policy server and robot client communicate via gRPC.

In this setup, gRPC channels are configured without TLS and without authentication, and incoming messages are deserialized using pickle.loads() directly.

The issue is relevant when these components are reachable over a network segment that may also be accessible to untrusted parties, such as shared lab networks, internal corporate networks with many tenants, or misconfigured cloud environments.

Exploit preconditions

  • Attack surface: Network-exposed gRPC endpoints of the policy server and robot client components.
  • Required access: Ability to reach the affected gRPC services over the network; no authentication is required in the described configuration.
  • Trigger points: Sending specially crafted pickle payloads via:
  • SendPolicyInstructions
  • SendObservations
  • GetActions

gRPC calls.

  • Why exploitation is possible: The system treats network-supplied data as trusted and passes it directly to pickle.loads(), a deserialization mechanism that can execute arbitrary code embedded in the payload, without prior validation, schema enforcement, or transport-layer protection.

Why this happens

This issue stems from using Python's pickle deserialization mechanism on data coming directly from the network.

Pickle is a general-purpose serialization format capable of encoding object construction and execution behavior, which makes it inherently unsafe for untrusted input.

Mapping to CWE-502: Unsafe Deserialization, the code path assumes incoming gRPC messages are benign and calls pickle.loads() without:

  • Restricting which types can be instantiated,
  • Validating content against a schema, or
  • Mediating deserialization through a safe, limited codec.

The lack of authentication and transport security further broadens the exposure, turning a local trust boundary assumption into a remote code execution condition.

Potential impact

  • Remote execution of arbitrary code in the context of the policy server process.
  • Remote execution of arbitrary code in the context of the robot client process, potentially affecting connected hardware.
  • Full compromise of affected hosts, including access to local credentials, configuration, and sensitive data.
  • Manipulation of robot behavior, leading to unsafe or unintended physical actions in robotic environments.
  • Use of compromised systems as a pivot point for lateral movement within the network.
  • Deployment of malware or persistence mechanisms on vulnerable servers or clients.

General mitigation guidance

Effective mitigation focuses on eliminating unsafe deserialization and tightening the trust boundary around inference traffic:

  • Replace pickle-based serialization for network-facing exchanges with safer formats such as JSON, Protocol Buffers, or other data-only codecs that cannot encode executable behavior.
  • Introduce explicit message schemas and validation layers on all gRPC endpoints so that only well-formed, typed data structures reach business logic.
  • Restrict what the server and client will process by enforcing authentication and authorization on all gRPC calls, reducing exposure to anonymous traffic.
  • Protect communication channels using TLS or equivalent transport security to reduce the chance of on-path message injection or manipulation.
  • Run policy server and robot client processes with least-privilege accounts and restrict filesystem and network access to limit the blast radius if deserialization issues occur in other areas.
  • Segment robotic infrastructure and inference services onto isolated network segments where only necessary, trusted components can initiate gRPC connections.

How teams detect issues like this

Detection typically combines code-level analysis with operational monitoring:

  • Static analysis and code review:
  • Search for calls to pickle.loads(), pickle.load(), or similar deserialization APIs used with data originating from sockets, gRPC stubs, or other network ingress points.
  • Flag any deserialization performed on unvalidated or unauthenticated inputs, especially in request handlers and service methods.
  • Review gRPC service definitions and implementations to confirm that message bodies are not turned directly into Python objects via pickle.
  • Policy and CI enforcement:
  • Establish coding standards that prohibit pickle for untrusted data and enforce them with linters or custom CI checks.
  • Integrate security-focused linters or SAST tools that recognize unsafe deserialization patterns and block merges when they appear.
  • Runtime monitoring:
  • Monitor for unusual process behavior such as unexpected child processes, outbound connections, or filesystem modifications by inference components.
  • Capture and inspect gRPC traffic in controlled environments to verify that only expected, structured formats are in use.

Automated code review tools and SAST platforms can help surface these patterns early, but should be complemented with manual architectural review of serialization and communication design.

Sources

SourceLink
chocapikk.comchocapikk.com/posts/2026/lerobot-pickle-rce/
github.comgithub.com/huggingface/lerobot/issues/3047
github.comgithub.com/huggingface/lerobot/issues/3134
github.comgithub.com/huggingface/lerobot/pull/3048
vulncheck.comvulncheck.com/advisories/lerobot-unsafe-deserialization-remote-code-execution-via-grpc

Frequently asked

questions

Yes. Because the vulnerable gRPC endpoints accept unauthenticated traffic over non-TLS channels, an attacker with network reachability to the policy server or robot client can attempt exploitation remotely.

The attacker primarily needs network access to the affected gRPC services. No valid credentials or prior foothold on the host are required under the described configuration, though existing network segmentation and firewalls may limit who can reach the endpoints.

The robust fix is to remove pickle from network-facing code paths and adopt a data-only serialization format with explicit schemas. Messages should be parsed into simple, well-defined data structures, and any complex object construction should be handled explicitly in application logic rather than via deserialization mechanisms that can execute code.

Future designs should treat all network input as untrusted, avoid general-purpose object deserialization formats for external data, and enforce authentication, authorization, and transport security on service boundaries. Establishing secure coding guidelines for serialization, using safer codecs by default, and incorporating security reviews into API and protocol design phases helps prevent similar vulnerabilities from emerging.

Find out what's already
exploitable in your codebase.