Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. smolagents
  4. ›
  5. CVE-2025-5120

CVE-2025-5120: smolagents has Sandbox Escape Vulnerability in the local_python_executor.py Module

July 27, 2025 (updated August 7, 2025)

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 approved 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.

References

  • github.com/advisories/GHSA-6v92-r5mx-h5fx
  • github.com/huggingface/smolagents
  • github.com/huggingface/smolagents/commit/33a942e62b6fbf6a35d41f1c735bda2d64c163d0
  • huntr.com/bounties/63ab1cfe-b573-4cf5-a7d3-fb6c957e34b0
  • nvd.nist.gov/vuln/detail/CVE-2025-5120

Code Behaviors & Features

Detect and mitigate CVE-2025-5120 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.17.0

Fixed versions

  • 1.17.0

Solution

Upgrade to version 1.17.0 or above.

Impact 10 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

pypi/smolagents/CVE-2025-5120.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 19 Aug 2025 12:19:07 +0000.