Skip to content

Remote Code Execution by Pickle Deserialization via FlaskRPCServer in fugue-project/fugue

High
kvnkho published GHSA-xv5p-fjw5-vrj6 Nov 25, 2025

Package

pip fugue (pip)

Affected versions

<=0.9.1

Patched versions

0.9.1

Description

Summary

The Fugue framework implements an RPC server system for distributed computing operations. In the core functionality of the RPC server implementation, I found that the _decode() function in fugue/rpc/flask.py directly uses cloudpickle.loads() to deserialize data without any sanitization. This creates a remote code execution vulnerability when malicious pickle data is processed by the RPC server.The vulnerability exists in the RPC communication mechanism where the client can send arbitrary serialized Python objects that will be deserialized on the server side, allowing attackers to execute arbitrary code on the victim's machine.

Details

_decode() function in fugue/rpc/flask.py directly uses cloudpickle.loads() to deserialize data without any sanitization.

PoC

  • Step1:
    The victim user starts an RPC server binding to open network using the Fugue framework. Here, I use the official RPC server code to initialize the server.

  • Step2:
    The attacker modifies the _encode() function in fugue/rpc/flask.py to inject malicious pickle data:

image

In this example, attacker modifies _encode to let the victim execute command “ls -l”

  • Step 3:
    The attacker then uses the RPC client to send the malicious request

We give a demo video and the PoC in the attachment, along with modified flask.py. When you reproduce this issue, in the server side (as an victim), you can run python rpc_server.py. In the client side (as an attacker), you can first replace fugue/rpc/flask.py in pip site-packages with provided flask.py in the attachment and then run rpc_client.py.

Impact

Remote code execution in the victim's machine. Once the victim starts the RPCServer with network binding (especially 0.0.0.0), an attacker on the network can gain arbitrary code execution by connecting to the RPCServer and sending crafted pickle payloads. This vulnerability allows for:

  • Complete system compromise
  • Data exfiltration
  • Lateral movement within the network
  • Denial of service attacks
  • Installation of persistent backdoors

Mitigation

  1. Replace unsafe deserialization: Replace pickle.loads() with safer alternatives such as:

    • JSON serialization for simple data structures
    • Protocol Buffers or MessagePack for complex data
    • If pickle must be used, implement a custom Unpickler with a restricted find_class() method that only allows whitelisted classes
  2. Network security:

    • If the service is intended for internal use only, bind to localhost (127.0.0.1) instead of 0.0.0.0
    • Implement authentication and authorization mechanisms
  3. Security warnings: When starting the service on public interfaces, display clear security warnings to inform users about the risks.

Attachment: https://drive.google.com/file/d/1y8bBBp7dnWoT_WHBtdB0Fts4NRUIfdWi/view?usp=sharing

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Adjacent
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

CVE ID

CVE-2025-62703

Weaknesses

Deserialization of Untrusted Data

The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. Learn more on MITRE.

Credits