CVE-2025-11844
XPath Injection in Hugging Face Smolagents search_item_ctrl_f Function
In short
The search_item_ctrl_f function in Hugging Face Smolagents unsafely combines user input into XPath queries without cleaning it first. An attacker can inject XPath code to access unintended elements, bypass filters, or disrupt automated web tasks.
Technical detail
XPath injection vulnerability in search_item_ctrl_f (src/smolagents/vision_web_browser.py) where user-supplied input is directly concatenated into XPath expressions without sanitization. An attacker can inject malicious XPath syntax to alter query logic, bypass filters, and access unintended DOM elements, potentially leading to information disclosure and disruption of web automation workflows. Fixed in version 1.22.0.
Summary generated and translated by AI from the official description.
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.
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Affected products
huggingface · huggingface/smolagentsWant to know if your infrastructure is exposed to this?
Talk to TrueHacking →