CVE-2025-5120

CVE-2025-5120 is a critical-severity vulnerability in Huggingface Smolagents with a CVSS 3.x base score of 10.0. Its EPSS exploit-prediction score of 19% places it in the 97th percentile, indicating an elevated likelihood of exploitation. The underlying weakness is classified as CWE-94.

Key facts

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.

Frequently asked questions

What is CVE-2025-5120?
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.
How severe is CVE-2025-5120?
CVE-2025-5120 has a CVSS 3.x base score of 10.0, rated critical severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is high, integrity high, and availability high.
Is CVE-2025-5120 being actively exploited?
It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 19% (97th percentile), an estimate of the probability of exploitation in the next 30 days.
What products are affected by CVE-2025-5120?
CVE-2025-5120 affects Huggingface Smolagents. See the affected-products list for the exact vulnerable versions.
How do I fix CVE-2025-5120?
Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its critical severity, prioritise patching exposed systems.
Does CVE-2025-5120 have an EU (EUVD) identifier?
Yes. CVE-2025-5120 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2025-22815.
When was CVE-2025-5120 published?
CVE-2025-5120 was published on 2025-07-27 and last updated on 2026-06-17.

References

Affected products (1)

More vulnerabilities in Huggingface Smolagents

All CVEs affecting Huggingface Smolagents →

Other CWE-94 (Code Injection) vulnerabilities

Browse all CWE-94 (Code Injection) vulnerabilities →