CVE-2025-11844
📋 TL;DR
Hugging Face Smolagents version 1.20.0 contains an XPath injection vulnerability in the search_item_ctrl_f function that allows attackers to inject malicious XPath syntax. This enables bypassing search filters, accessing unintended DOM elements, and disrupting web automation workflows, potentially leading to information disclosure and manipulation of AI agent interactions. Users of Smolagents 1.20.0 who process untrusted input in web automation tasks are affected.
💻 Affected Systems
- Hugging Face Smolagents
📦 What is this software?
Smolagents by Huggingface
⚠️ Risk & Real-World Impact
Worst Case
Complete compromise of web automation workflows, unauthorized access to sensitive DOM elements, manipulation of AI agent decision-making, and potential data exfiltration from automated web interactions.
Likely Case
Bypass of search filters leading to unintended DOM element access, disruption of automated web tasks, and potential information disclosure from web pages being processed.
If Mitigated
Limited impact with proper input validation and sanitization, potentially only causing minor automation workflow disruptions.
🎯 Exploit Status
Exploitation requires the ability to supply input to the vulnerable function, which typically requires some level of access to the automation system.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.22.0
Vendor Advisory: https://github.com/huggingface/smolagents/commit/f570ed5e17999d4cf7d5e79c2830fbaefab8a794
Restart Required: No
Instructions:
1. Update Smolagents to version 1.22.0 or later using pip: pip install --upgrade smolagents>=1.22.0
2. Verify the update completed successfully
3. Test web automation workflows to ensure functionality
🔧 Temporary Workarounds
Input Validation and Sanitization
allImplement strict input validation and sanitization for all user-supplied input passed to the search_item_ctrl_f function
Function Restriction
allRestrict or disable the search_item_ctrl_f function if not essential for operations
🧯 If You Can't Patch
- Implement strict input validation to sanitize all user input before passing to XPath queries
- Use parameterized XPath queries or XPath libraries that support safe parameter binding
🔍 How to Verify
Check if Vulnerable:
Check if Smolagents version is 1.20.0 by examining package version or running: python -c "import smolagents; print(smolagents.__version__)"
Check Version:
python -c "import smolagents; print(smolagents.__version__)"
Verify Fix Applied:
Verify Smolagents version is 1.22.0 or higher using: python -c "import smolagents; print(smolagents.__version__)"
📡 Detection & Monitoring
Log Indicators:
- Unusual XPath query patterns
- Failed web automation tasks
- Unexpected DOM element access attempts
Network Indicators:
- Abnormal web request patterns from automation systems
SIEM Query:
source="smolagents" AND (event="xpath_error" OR event="search_failure")