Severity:

HIGH RISK

(7.3)

Unsafe Deserialization in FedML gRPC Server sendMessage

CVE-2026-5536

Analyzed

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-20, CWE-502

Impact:

Remote Code Execution and Data Compromise

Severity:

HIGH RISK

(7.3)

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

FedML-AI FedML up to version 0.8.9 contains an unsafe deserialization issue in the gRPC server's sendMessage function, where inbound messages can be processed without sufficient validation.

A remote attacker who can send crafted data to the gRPC endpoint may be able to trigger unsafe deserialization behavior, potentially leading to code execution, data tampering, or denial of service.

Affected context

The vulnerability exists in deployments of FedML-AI FedML (≤ 0.8.9) that expose the gRPC server component, specifically the sendMessage function in grpc_server.py.

It is most relevant when the gRPC server is reachable over the network (e.g., in distributed or federated learning setups) and accepts messages from nodes or clients that are not fully trusted or strictly authenticated.

In such environments, attacker-controlled or malformed messages can traverse the gRPC boundary and reach the deserialization logic without adequate input validation or type safety guarantees.

Exploit preconditions

  • Attack surface: Network-accessible FedML gRPC server endpoint exposing the sendMessage function.
  • Required access: Ability to establish a gRPC connection and send crafted messages; this may be possible for remote clients, peers, or compromised participants in the federated learning ecosystem.
  • Trigger point: Server-side handling of incoming messages in sendMessage, where message data is deserialized or converted into objects.
  • Why exploitation is possible: The server logic implicitly trusts message structure and content, performing deserialization without sufficient validation, schema enforcement, or restriction of allowable types, which aligns with CWE-502 combined with improper input validation (CWE-20).

Why this happens

At a design level, the gRPC server's sendMessage function appears to treat incoming data as trustworthy and directly deserializes it into application-level objects.

This pattern aligns with CWE-502: Deserialization of Untrusted Data, where encoded data from external sources is converted into live objects without restricting what can be created or how constructors behave.

The situation is further aggravated by CWE-20: Improper Input Validation, as the server does not adequately validate message content, structure, or origin before deserialization, allowing attacker-controlled payloads to influence the deserialization process and potentially the control flow of the application.

Potential impact

  • Remote execution of arbitrary code within the FedML gRPC server process (depending on the deserialization mechanism and environment).
  • Tampering with in-memory state, including model parameters, gradients, or control messages in federated learning workflows.
  • Denial of service through crafted payloads that cause crashes, excessive resource consumption, or deserialization errors.
  • Unauthorized access to or exfiltration of sensitive information processed or cached by the server.
  • Lateral movement within the hosting environment if the service runs with elevated privileges or has access to additional internal services.

General mitigation guidance

Effective mitigation focuses on reducing trust in incoming messages and strictly controlling deserialization behavior:

  • Prefer serialization formats and frameworks that do not support arbitrary object graphs or code execution (e.g., using schema-based, data-only formats).
  • Introduce strict schema validation for all gRPC messages before any deserialization or conversion into internal objects; reject messages that deviate from expected structure or types.
  • Avoid generic deserialization of opaque blobs into dynamic objects; instead, map messages to well-defined data transfer objects with explicit field definitions.
  • Enforce strong authentication and authorization for all gRPC clients, minimizing exposure to untrusted senders in federated deployments.
  • Run the gRPC server under least-privilege accounts and consider process isolation or containerization to reduce the blast radius if deserialization is abused.
  • Apply input size limits, timeouts, and resource controls on incoming requests to mitigate denial-of-service vectors.

How teams detect issues like this

Organizations can use a combination of code-level and operational techniques to detect this class of vulnerability:

  • Static analysis: Configure rules to flag usage of generic or unsafe deserialization APIs in network-facing handlers, especially in grpc_server.py and related modules.
  • Targeted code review: Examine endpoints that receive external input (including sendMessage) for direct deserialization of request content, lack of schema checks, or use of reflection/dynamic types.
  • Logging and monitoring: Instrument the gRPC server to log unusual deserialization failures, malformed messages, or spikes in error rates, and correlate them with client identities and source IPs.
  • Security testing: Incorporate fuzzing and negative testing for gRPC endpoints, validating how the service behaves when receiving malformed or boundary-case messages.
  • Policy enforcement: Use CI/CD checks and automated review tools to prevent introducing new unsafe deserialization patterns and to guard against regression.

Sources

SourceLink
github.comgithub.com/AnalogyC0de/public_exp/issues/26
vuldb.comvuldb.com/submit/782201
vuldb.comvuldb.com/vuln/355289
vuldb.comvuldb.com/vuln/355289/cti

Frequently asked

questions

Yes. Because the affected functionality resides in the network-exposed gRPC server, a remote attacker who can reach the sendMessage endpoint may be able to exploit the unsafe deserialization behavior, subject to any authentication or network restrictions in place.

The attacker needs the ability to act as a gRPC client and send crafted messages to the server. In some deployments this may require valid client credentials or participation in the federated learning setup; in others, a publicly exposed endpoint may allow unauthenticated access.

The most robust pattern is to eliminate unsafe deserialization of untrusted data altogether: rely on schema-based, data-only message formats; map messages to strongly typed, validated structures; and ensure no code execution or arbitrary object instantiation is possible during deserialization.

Adopt a design principle that treats all external inputs—even from nominally trusted peers—as untrusted, enforce strict input validation before processing, avoid generic deserialization APIs in network handlers, and integrate security review and static analysis checks for serialization/deserialization logic into the development lifecycle.

Find out what's already
exploitable in your codebase.