CVE-2026-115533
Arbitrary code execution via unsafe dynamic class loading in LeRobot's from_pretrained().
- CWE-470 (inferred)
- Design Defects
- Remote
The LeRobot library is vulnerable to arbitrary code execution via unsafe dynamic class instantiation in the from_pretrained() method and related paths. When loading a policy's processor configuration from a repository, the library uses the class field within the JSON configuration to dynamically resolve and instantiate Python classes using importlib.import_module() and getattr().
- CWE
- CWE-470 (inferred)
- Published
- 2026-10-26
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Design Defects
- Subcategory
- Security Misconfigurations
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- LeRobot
- Fixed by upgrading
- Yes
Solution
Upgrade the LeRobot library to version 0.3.2 or newer, which disables unsafe dynamic class loading in from_pretrained() and validates processor classes securely.
Vulnerable code sample
import json
import importlib
def load_processor(config_path):
"""
Load a processor class as described in a JSON config.
The config must contain a 'class' field with the fully‑qualified class name.
"""
with open(config_path, 'r') as f:
cfg = json.load(f)
# VULNERABLE: dynamic import without validation enables arbitrary code execution
module_path, class_name = cfg['class'].rsplit('.', 1)
module = importlib.import_module(module_path)
ProcessorCls = getattr(module, class_name)
return ProcessorCls(**cfg.get('kwargs', {}))Patched code sample
import json
import importlib
def load_processor(config_path):
"""
Load a processor class as described in a JSON config.
The config must contain a 'class' field with the fully‑qualified class name.
"""
with open(config_path, 'r') as f:
cfg = json.load(f)
# FIX: restrict instantiation to known safe processor classes
allowed = {
'lerobot.processor.TextProcessor',
'lerobot.processor.ImageProcessor',
}
class_path = cfg['class']
if class_path not in allowed:
raise ValueError(f"Disallowed processor class: {class_path}")
module_path, class_name = class_path.rsplit('.', 1)
module = importlib.import_module(module_path)
ProcessorCls = getattr(module, class_name)
return ProcessorCls(**cfg.get('kwargs', {}))Cite this entry
@misc{vaitp:cve2026115533,
title = {{Arbitrary code execution via unsafe dynamic class loading in LeRobot's from_pretrained().}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-115533},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-115533/}}
}
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 ::
