CVE-2025-11844: Smolagents Hugging Face Smolagents XPath Injection Vulnerability
MODERATECVE-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
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).
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.
pip install smolagents>=1.22.0
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
CVE-2025-11844 Affected Smolagents Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
smolagents
|
PyPI |
< 1.22.0
|
1.22.0
|
References
Frequently Asked Questions
What is CVE-2025-11844?
Which Smolagents versions are affected?
What version fixes CVE-2025-11844?
Is smolagents affected?
What is the CVSS score of CVE-2025-11844?
What CWE is associated with CVE-2025-11844?
How can I check PyPI dependencies for CVE-2025-11844?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}