XPath Injection Vulnerability in Hugging Face Smolagents Web Automation Tool
CVE-2025-11844
5.4MEDIUM
What is CVE-2025-11844?
The Hugging Face Smolagents version 1.20.0 is susceptible to an XPath injection vulnerability within the search_item_ctrl_f function found in src/smolagents/vision_web_browser.py. This vulnerability arises from the direct incorporation of user-input into an XPath query without sufficient sanitization and escaping. Attackers can exploit this weakness to inject malicious XPath syntax, potentially altering the logic of queries, bypassing search filters, and accessing unintended DOM elements. As a result, this can lead to information leakage, manipulation of AI agent interactions, and instabilities in web automation processes. The vulnerability has been patched in version 1.22.0.
Affected Version(s)
huggingface/smolagents < 1.22.0
