A sandbox escape vulnerability was identified in huggingface/smolagents version 1.14.0, allowing attackers to bypass the restricted execution environment and achieve remote code execution (RCE). The vulnerability stems from the local_python_executor.py module, which inadequately restricts Python code execution despite employing static and dynamic checks. Attackers can exploit whitelisted modules and functions to execute arbitrary code, compromising the host system. This flaw undermines the core security boundary intended to isolate untrusted code, posing risks such as unauthorized code execution, data leakage, and potential integration-level compromise. The issue is resolved in version 1.17.0.
The vulnerability is located in the local_python_executor.py module, which is responsible for isolated execution of Python code. The applied control mechanisms — both static and dynamic — are insufficient and leave exploitable gaps. An attacker can use allowed (whitelisted) modules and functions to execute arbitrary code outside the sandbox, effectively bypassing the intended security boundary of the execution environment.
An attacker can execute arbitrary code on the host system (RCE), leading to unauthorized access, data leakage, and potential compromise of components integrated with the library.
The Huggingface Smolagents library should be updated to version 1.17.0, where the issue has been resolved. The patch is available in the project repository on GitHub.
Huggingface Smolagents version 1.14.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:HHuggingface Smolagents
APPHuggingface1.14.0
Related vulnerabilities
Hugging Face Smolagents version 1.20.0 contains an XPath injection vulnerability in the search_item_ctrl_f fun...
W huggingface smolagents 1.25.0.dev0 wykryto słabość. Dotyczy to funkcji evaluate_augassign/evaluate_call/eval...
W huggingface smolagents 1.24.0 zidentyfikowano słabość w funkcji requests.get/requests.post komponentu LocalP...
RCE w Huggingface Transformers — obejście trust_remote_code w LightGlue
Niebezpieczna deserializacja w LeRobot — RCE przez gRPC bez uwierzytelnienia