CVE-2025-61765: python-socketio vulnerable to arbitrary Python code execution (RCE) through malicious pickle deserialization in certain multi-server deployments
6.4
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| python-socketio | pip | >= 0.8.0, < 5.14.0 | 5.14.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability is a classic case of insecure deserialization (CWE-502) within the python-socketio library. The issue arises when multiple python-socketio servers are configured in a cluster using a message queue (like Redis, RabbitMQ, Kafka, etc.) for inter-process communication. The library used Python's pickle module to serialize and deserialize messages exchanged between these servers.
An attacker who gains access to this internal message queue can inject a malicious, specially crafted pickle payload. When a server process retrieves this message from the queue, it uses pickle.loads() to deserialize it. The pickle module is not secure against erroneous or maliciously constructed data. A malicious pickle can be constructed to execute arbitrary code upon deserialization, leading to a Remote Code Execution (RCE) vulnerability in the context of the server process.
The provided patch mitigates this vulnerability by completely removing the usage of pickle for serialization across all message queue managers (Redis, Kafka, RabbitMQ, ZMQ). It replaces pickle with the much safer json module. JSON is a pure data format and does not have the capability to execute code, thus eliminating the deserialization vulnerability.
The identified vulnerable functions are the specific methods within the various message queue manager classes that were responsible for calling pickle.loads() on incoming data from the queue. These functions represent the direct entry point for the exploit.
Vulnerable functions
AsyncPubSubManager._threadsrc/socketio/async_pubsub_manager.py
PubSubManager._threadsrc/socketio/pubsub_manager.py
AioPikaManager._listensrc/socketio/async_aiopika_manager.py
KafkaManager._listensrc/socketio/kafka_manager.py
ZmqManager._listensrc/socketio/zmq_manager.py