{"answers":{"affected":"3 open source packages ship an affected version, including smolagents. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-5120 exists.","fix":"Upgrade smolagents to 1.17.0 or later.","what":"CVE-2025-5120 is a high-severity code injection vulnerability in huggingface/smolagents, published on 27 Jul 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2025-5120 and fix it if it is affected.\n\nWhat it is: CVE-2025-5120 is a high-severity code injection vulnerability in huggingface/smolagents, published on 27 Jul 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-5120 exists.\n\nAffected packages and fixed versions:\n- smolagents (PyPI): affected all versions; fixed in 1.17.0\n- smolagents (PyPI): affected all versions; fixed in 1.17.0\n- smolagents (PyPI): affected all versions; fixed in 1.17.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-5120/ (Markdown: https://insights.sbomify.com/CVE-2025-5120/index.md)","id":"CVE-2025-5120","markdown":"https://insights.sbomify.com/CVE-2025-5120/index.md","name":"CVE-2025-5120","record":{"aliases":["GHSA-6v92-r5mx-h5fx","PYSEC-2026-542"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Python agent library","requires_auth":"none","summary":"Attackers can bypass sandbox restrictions in huggingface/smolagents to execute arbitrary code on the host system, leading to remote code execution and data leakage.","user_interaction":"required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"@huntr_ai","cpe":[{"product":"smolagents","vendor":"huggingface"}],"cvss":{"score":7.6,"severity":"high","source":"cna","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L","version":"3.0"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Sandbox Escape Vulnerability in huggingface/smolagents","id":"CVE-2025-5120","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2025"},"n_packages":3,"n_references":2,"next":{"headline":"Missing Authorization in GitLab","id":"CVE-2025-5121"},"packages":[{"ecosystem":"PyPI","fixed":["1.17.0"],"introduced":["0"],"last_affected":[],"package":"smolagents","purl":null,"source":"GHSA-6v92-r5mx-h5fx"},{"ecosystem":"PyPI","fixed":["1.17.0"],"introduced":["0"],"last_affected":[],"package":"smolagents","purl":"pkg:pypi/smolagents","source":"GHSA-6v92-r5mx-h5fx"},{"ecosystem":"PyPI","fixed":["1.17.0"],"introduced":["0"],"last_affected":[],"package":"smolagents","purl":"pkg:pypi/smolagents","source":"PYSEC-2026-542"}],"prev":{"headline":"Emlog Pro api_controller.php sql injection","id":"CVE-2025-5119"},"products":["huggingface/smolagents"],"published":"2025-07-27","related":[{"cvss_score":5.4,"headline":"XPath Injection in Hugging Face Smolagents search_item_ctrl_f Function","id":"CVE-2025-11844","kev_date_added":null,"published":"2025-10-22"},{"cvss_score":5.3,"headline":"huggingface smolagents Incomplete Fix CVE-2025-9959 local_python_executor.py evaluate_with code injection","id":"CVE-2026-4963","kev_date_added":null,"published":"2026-03-27"},{"cvss_score":5.3,"headline":"huggingface smolagents LocalPythonExecutor requests.post server-side request forgery","id":"CVE-2026-2654","kev_date_added":null,"published":"2026-02-18"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-07-28","vendors":["huggingface"]},"summary":"Attackers can bypass sandbox restrictions in huggingface/smolagents to execute arbitrary code on the host system, leading to remote code execution and data leakage.","url":"https://insights.sbomify.com/CVE-2025-5120/"}