CVE-2025-5120

7.6

Hugging Face · smolagents

A sandbox escape vulnerability in the smolagents local_python_executor module allows attackers to bypass security restrictions and achieve remote code execution on the host system.

Executive summary

A critical sandbox escape vulnerability in Hugging Face smolagents allows unauthenticated attackers to achieve remote code execution by bypassing restricted execution environments.

Vulnerability

This vulnerability is a sandbox escape (CWE-94) located in the local_python_executor.py module, which fails to sufficiently restrict code execution despite static and dynamic checks. An attacker can leverage whitelisted modules to execute arbitrary code outside the intended security boundary.

Business impact

The ability to achieve remote code execution poses a severe risk to organizational infrastructure, as it allows attackers to execute arbitrary commands with the privileges of the application. Given the CVSS score of 7.6, this vulnerability represents a high-severity threat that could lead to full system compromise, sensitive data exfiltration, or lateral movement within the network.

Remediation

Immediate Action: Update the smolagents package to version 1.17.0 or later immediately to apply the necessary security patches.

Proactive Monitoring: Review application and system access logs for anomalous execution patterns or unauthorized calls to system modules originating from the smolagents sandbox environment.

Compensating Controls: Implement strict network segmentation and egress filtering to limit the potential impact of a successful host compromise, and ensure the application runs with the least privilege necessary.

Exploitation status

Public Exploit Available: Unknown

Analyst recommendation

Given the potential for remote code execution and the existence of proof-of-concept evidence, organizations utilizing smolagents must prioritize this update. Administrators should verify their current version and patch to 1.17.0 without delay to neutralize the risk of sandbox bypass and subsequent system compromise.

More Hugging Face CVEs

Sources