CVE-2025-5120: huggingface/smolagents · Improper Control of Generation of Code
Affects huggingface/smolagentsSource CVE Database V5
Not known to be exploited · 26% EPSS · CVSS 7.6 High : upgrade to 1.17.0 soon.
Data as of 26 Oct 2026, 06:26 UTC
- EPSS
- 26.3% chance of exploitation in 30 days – higher than 97% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 1.17.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:LExploitation evidence
Disclosed: evidence found.
CVE published 27 Jul 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-26.
What to do
Upgrade huggingface/smolagents to 1.17.0.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
GitHubhuggingface/smolagentspkg:github/huggingface/smolagentsOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Mitigation requires immediate upgrade of huggingface/smolagents to version 1.17.0 or later, where the vulnerability is fixed. Organizations should audit their use of the local_python_executor.py module and restrict its usage to trusted code only. Implement strict input validation and sandboxing policies beyond the library’s default controls, possibly leveraging containerization or OS-level sandboxing to add defense-in-depth. Monitor logs for unusual execution patterns or attempts to invoke whitelisted modules/functions in unexpected ways. Employ network segmentation to limit exposure of systems running vulnerable versions. User training to recognize and avoid social engineering attempts that could trigger the vulnerability is critical. Additionally, organizations should maintain an inventory of AI/ML tools in use and ensure timely patch management processes are in place for such dependencies.
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.