Hugging Face Smolagents XPath injection vulnerability in the search_item_ctrl_f function
Moderate severity
GitHub Reviewed
Published
Oct 22, 2025
to the GitHub Advisory Database
•
Updated Oct 22, 2025
Description
Published by the National Vulnerability Database
Oct 22, 2025
Published to the GitHub Advisory Database
Oct 22, 2025
Reviewed
Oct 22, 2025
Last updated
Oct 22, 2025
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.
References