Cyber Resilience

CVE-2025-5120

RCE in Huggingface Smolagents 1.14.0

Public PoCRCE
Published
27 July 2025
Modified
17 June 2026
Patch / advisory
CVSS Score v3.1 10.0
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
EPSS Score 0.19 97th percentile
Risk Priority 86 floored blend · peak EPSS

Summary

CVE-2025-5120 is a critical-severity Code Injection (CWE-94) vulnerability in Huggingface Smolagents. Its CVSS base score is 10.0 (Critical).

Operationally, exploitation aligns with the MITRE ATT&CK technique Command and Scripting Interpreter (T1059); ranked in the top 3% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

This vulnerability is AI-related — categorised as AI Agent Protocols and Integrations; in the LLM/Generative AI Risks risk domain.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

A sandbox escape vulnerability was identified in huggingface/smolagents version 1.14.0, specifically in the local_python_executor.py module. The component employs static and dynamic checks to restrict Python execution but fails to prevent use of whitelisted modules and functions, enabling attackers to bypass the sandbox and achieve remote code execution. The flaw carries a CVSS score of 10.0 and is tracked under CWE-94; it was fixed in version 1.17.0.

An unauthenticated attacker with network access can supply crafted code that abuses permitted imports and calls to escape the restricted environment, resulting in arbitrary command execution on the host, data exfiltration, or broader compromise of any system integrating the library. The attack requires no user interaction and breaks the core isolation boundary intended for untrusted agent-generated code.

The issue is addressed by the patch at commit 33a942e62b6fbf6a35d41f1c735bda2d64c163d0, with further details available in the associated huntr.com bounty report. The EPSS score has remained flat at 0.0187 since disclosure, indicating limited observed exploitation interest to date. The affected library is an AI agent framework, making the sandbox bypass particularly relevant to deployments that execute model-generated Python in shared or production environments.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

AI Security AnalysisAI

AI Category
AI Agent Protocols and Integrations
Risk Domain
LLM/Generative AI Risks
OWASP Top 10 for LLMs 2025
None mapped
Classification Reason
Matched keywords: huggingface

Related Threats

MITRE ATT&CK Enterprise Techniques

T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
T1059.001 PowerShell Execution
Adversaries may abuse PowerShell commands and scripts for execution.
T1059.002 AppleScript Execution
Adversaries may abuse AppleScript for execution.
T1059.004 Unix Shell Execution
Adversaries may abuse Unix shell commands and scripts for execution.
T1059.005 Visual Basic Execution
Adversaries may abuse Visual Basic (VB) for execution.
T1059.006 Python Execution
Adversaries may abuse Python commands and scripts for execution.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-4963Same product: Huggingface Smolagents
CVE-2025-11844Same product: Huggingface Smolagents
CVE-2026-2654Same product: Huggingface Smolagents
CVE-2025-14927Same vendor: Huggingface
CVE-2025-14928Same vendor: Huggingface
CVE-2025-14926Same vendor: Huggingface
CVE-2026-44827Same vendor: Huggingface
CVE-2026-44513Same vendor: Huggingface
CVE-2026-67531Shared CWE-94
CVE-2025-61929Shared CWE-94

Affected Assets

huggingface
smolagents
1.14.0

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)
  • V1.3.1

Mitigating Controls (NIST 800-53 r5) AI

Developer testing and evaluation finds code paths that accept and execute externally influenced strings.

Input validation directly stops untrusted data from being used to construct executable code without neutralization.

Least privilege limits the damage an injected code fragment can perform once executed.

Requiring documented secure development standards and tools enforces use of safe code-generation APIs and escaping.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

PR.PS-06's SDLC practices directly target injection flaws via secure coding and testing (mostly), yet as a single broad outcome it leaves many code-generation specifics unaddressed (partial).

PR.DS-10 none match
prevents

PR.DS-10 protects runtime data confidentiality/integrity but has no bearing on neutralizing externally influenced input during code generation, so neither direction shows any preventive effect.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

prevents

Banning unapproved code samples and unauthenticated web services, combined with secure-coding standards and SAST, prevents the dynamic generation or inclusion of attacker-supplied code.

none

Controls that restrict unauthorized or malicious code from being introduced via external networks or removable media limit opportunities for an attacker to inject and execute arbitrary code.

References