CVE-2025-11844: Smolagents Hugging Face Smolagents XPath Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-8mf9-rmgw-33qc
CVSS 5.4
CWE-643
Published
Advisory Summary

CVE-2025-11844 is a MODERATE (CVSS 5.4) hugging face smolagents xpath injection vulnerability (CWE-643: Improper Neutralization of Data within XPath Expressions ('XPath Injection')) affecting Smolagents libraries in the PyPI ecosystem. The issue involves hugging face smolagents xpath injection vulnerability in the search_item_ctrl_f function. Remediation is available by upgrading affected packages to version 1.22.0.

CVE-2025-11844 at a Glance

CVE Identifier CVE-2025-11844
GHSA Identifier GHSA-8mf9-rmgw-33qc
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-643: Improper Neutralization of Data within XPath Expressions ('XPath Injection')
Affected Product Smolagents
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-11844

To remediate this vulnerability, upgrade all affected Smolagents dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

smolagents fixed: 1.22.0
pip install smolagents>=1.22.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show smolagents

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-11844, inspect your installed packages using pip:

pip show smolagents

Analyze the terminal output to locate any version of Smolagents in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.22.0), your application is affected.

Note: The pip show smolagents command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-643: Improper Neutralization of Data within XPath Expressions ('XPath Injection'), where the product uses external input to dynamically construct an xpath expression used to retrieve data from an xml database, but it does not neutralize or incorrectly neutralizes that input. this allows an attacker to control the structure of the query. In Smolagents, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Hugging Face Smolagents version 1.20.0 contains an XPath injection vulnerability in the search_item_ctrl_f function located in src/smolagents/vision_web_browser.py. The function constructs an XPath query by directly concatenating user-supplied input into the XPath expression without proper sanitization or escaping. This allows an attacker to inject malicious XPath syntax that can alter the intended query logic. The vulnerability enables attackers to bypass search filters, access unintended DOM elements, and disrupt web automation workflows. This can lead to information disclosure, manipulation of AI agent interactions, and compromise the reliability of automated web tasks. The issue is fixed in version 1.22.0.

CVE-2025-11844 Affected Smolagents Versions

1 component(s)
Fixed Versions:
1.22.0
Product / Package Ecosystem Affected Versions Fixed Version
smolagents
PyPI
< 1.22.0
1.22.0

References

Frequently Asked Questions

What is CVE-2025-11844?
CVE-2025-11844 is a security vulnerability in Smolagents involving Hugging Face Smolagents XPath injection vulnerability in the search_item_ctrl_f function under CWE-643: Improper Neutralization of Data within XPath Expressions ('XPath Injection').
Which Smolagents versions are affected?
Affected versions include releases prior to 1.22.0 across affected packages: smolagents.
What version fixes CVE-2025-11844?
Upgrading to 1.22.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is smolagents affected?
Yes, smolagents is affected in releases prior to 1.22.0. Upgrade your dependency to 1.22.0 or later.
What is the CVSS score of CVE-2025-11844?
CVE-2025-11844 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2025-11844?
CVE-2025-11844 is classified under CWE-643: Improper Neutralization of Data within XPath Expressions ('XPath Injection') (The product uses external input to dynamically construct an XPath expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.).
How can I check PyPI dependencies for CVE-2025-11844?
Run the dependency tree command: 'pip show smolagents'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8mf9-rmgw-33qc",
  "modified" : "2025-10-22T19:38:34Z",
  "published" : "2025-10-22T15:31:11Z",
  "aliases" : [ "CVE-2025-11844" ],
  "summary" : "Hugging Face Smolagents XPath injection vulnerability in the search_item_ctrl_f function",
  "details" : "Hugging Face Smolagents version 1.20.0 contains an XPath injection vulnerability in the search_item_ctrl_f function located in src/smolagents/vision_web_browser.py. The function constructs an XPath query by directly concatenating user-supplied input into the XPath expression without proper sanitization or escaping. This allows an attacker to inject malicious XPath syntax that can alter the intended query logic. The vulnerability enables attackers to bypass search filters, access unintended DOM elements, and disrupt web automation workflows. This can lead to information disclosure, manipulation of AI agent interactions, and compromise the reliability of automated web tasks. The issue is fixed in version 1.22.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "smolagents"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.22.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-11844"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/huggingface/smolagents/commit/f570ed5e17999d4cf7d5e79c2830fbaefab8a794"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/huggingface/smolagents"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/01ab4405-9bca-4b26-b7a3-5ca1863a69b4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-643" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-10-22T19:38:34Z",
    "nvd_published_at" : "2025-10-22T14:15:49Z"
  }
}