smolagents has Sandbox Escape Vulnerability in the local_python_executor.py Module
CVE-2025-5120 · GHSA-6v92-r5mx-h5fx · published 2025-07-27 · updated 2025-08-07
- Severity
- Critical
- CVSS score
- 9.9
- Chance of exploitation (EPSS)
- 31.2%
- Fixed in
- 1.17.0
- Exploitation Public proof of concept
- Automatable No
- Technical impact Partial
- CISA SSVC
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 localpythonexecutor.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.
Upgrade smolagents to 1.17.0 or later. If you start it from an MCP config with npx or uvx, pin that version so an old cached copy is not used.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| smolagents | PyPI | < 1.17.0 | 1.17.0 |
- CriticalUnauthenticated Remote Code Execution in Langflow via Public Flow Build EndpointlangflowExploited
- CriticalRay is vulnerable to Critical RCE via Safari & Firefox Browsers through DNS Rebinding AttackrayExploited
- CriticalLangflow Unauth RCElangflow, langflow-baseExploited
- HighLiteLLM: Authenticated command execution via MCP stdio test endpointslitellmExploited
- CriticalMLflow vulnerable to remote code execution on unauthenticated servers via third-party scorer deserialization importing caller-placed artifacmlflow
- CriticalAgno: Arbitrary code execution via `eval()` on `field_type` in `FunctionCall`agno
- CriticalHugging Face smolagents: Unsafe deserialization in Remote Python Executor leads to RCEsmolagents
- MediumHugging Face Smolagents XPath injection vulnerability in the search_item_ctrl_f functionsmolagents
- LowHugging Face Smolagents has an Injection issuesmolagents
- LowHugging Face Smolagents has a Server-Side Request Forgery issuesmolagents
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.