CVE-2025-9959 Details
Description
Incomplete validation of dunder attributes allows an attacker to escape from the Local Python execution environment sandbox, enforced by smolagents. The attack requires a Prompt Injection in order to trick the agent to create malicious code.
A vulnerability in Hugging Face Smolagents' Local Python execution environment allows for sandbox escape via dunder attributes. This issue arises from incomplete validation of these attributes, enabling an attacker to perform a Prompt Injection that tricks the agent into executing malicious code. The vulnerability is present in Smolagents versions prior to 1.21.0.
When using Smolagents, avoid the Local Python execution environment. Instead, use the WebAssembly executor, which does not have this vulnerability. For example, create a 'CodeAgent' with 'executor_type' set to 'wasm'.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Sep 3, 2025CISA-ADP
Assessed Sep 3, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/huggingface/smolagents/pull/1551 | [email protected] | Issue TrackingVendor |
| https://research.jfrog.com/vulnerabilities/smolagents-local-python-sandbox-escape-jfsa-2025-001434277/ | [email protected] | AdvisoryExploitRemedy |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| huggingface smolagents | All versions |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Sep 26, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Sep 3, 2025 | New CVE Received | [email protected] |
Volerion