Arbitrary Code Injection Affecting smolagents package, versions [,1.21.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.05% (14th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-SMOLAGENTS-12549208
  • published7 Sept 2025
  • disclosed3 Sept 2025
  • creditUnknown

Introduced: 3 Sep 2025

NewCVE-2025-9959  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade smolagents to version 1.21.0 or higher.

Overview

smolagents is a 🤗 smolagents: a barebones library for agents. Agents write python code to call tools or orchestrate other agents.

Affected versions of this package are vulnerable to Arbitrary Code Injection due to incomplete validation of dunder attributes, that allows an attacker to escape from the Local Python execution environment sandbox. The attack requires a Prompt Injection in order to trick the agent to create malicious code.

CVSS Base Scores

version 4.0
version 3.1