Hugging Face Smolagents CVE-2025-11844
MEDIUMAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPlant malicious text in web content
-
DeliveryAgent passes text to Ctrl-F search
-
ExploitBreak out of XPath contains() predicate
-
ExecutionSelect unintended DOM elements
-
ImpactDisclose data or corrupt agent workflow
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization XPath expression sanitization
|
| Exploitation Conditions | Exploitation requires the Smolagents vision web browser module (src/smolagents/vision_web_browser.py) to be in use on version 1.20.0, and specifically requires the search_item_ctrl_f function to be invoked with attacker-influenced text - e.g., the AI agent is induced to run a Ctrl-F-style search on attacker-controlled page content or on a prompt-injected search term. The limiting factor is this user/agent interaction (CVSS UI:R): the flaw is not triggered passively, so an attacker must get their payload routed into the search text. No authentication is required (PR:N). Impact is bounded to altered XPath query results (filter bypass, access to unintended DOM elements, information disclosure, and disruption of the automation workflow) rather than system code execution. |
| Impact | This is a genuinely moderate (not high-priority) issue, and the signals are internally consistent. The CVSS 3.0 vector (AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N = 5.4) indicates a network-reachable, low-complexity, unauthenticated flaw that nonetheless requires user interaction and yields only low confidentiality and integrity impact with no availability impact - matching CWE-643 (XPath injection) where an attacker alters query logic rather than achieving code execution. Supporting signals point to low urgency: EPSS is 0.28% (19th percentile), the flaw is NOT in CISA KEV, and there is no evidence of active exploitation. The one elevating signal is a publicly available exploit (huntr bounty 01ab4405), but POC availability is distinct from active exploitation. The UI:R requirement is the key limiter: exploitation depends on the AI agent actually invoking search_item_ctrl_f with attacker-influenced text (e.g., via prompt injection or attacker-controlled web content), which is more of a targeted/opportunistic path than mass-exploitable. Net: a legitimate bug worth patching on a normal cycle, not an emergency. No major data conflicts; the vector and description align well. |
| Exploit ScenarioDerived | An attacker plants crafted text on a web page (or injects it through agent prompt manipulation) that is later passed to the Smolagents vision web browser's Ctrl-F search; because the text is concatenated directly into an XPath expression, the attacker breaks out of the intended contains() predicate and injects their own XPath to select unintended DOM nodes, bypass search filters, or exfiltrate page data. A public proof-of-concept exists (huntr), and the low-complexity, unauthenticated vector means exploitation is straightforward once the agent is induced to search attacker-controlled input. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 08, 2026
XPath injection in Hugging Face Smolagents 1.20.0 lets an attacker who can influence the text passed to the vision web browser's Ctrl-F style search (search_item_ctrl_f) rewrite the underlying XPath query, bypassing intended search filters and pulling in unintended DOM elements. The flaw is reachable without authentication (CVSS PR:N) but requires the agent or user to trigger the search with attacker-influenced text (UI:R), so it is not passively exploitable; impact is bounded to information disclosure from the queried page, manipulation of agent search results, and disruption of automation workflows rather than code execution. Publicly available exploit code exists, but there is no confirmed active exploitation (not in CISA KEV), and EPSS is low at 0.28% (19th percentile), making this a moderate, situational risk rather than a high-priority emergency.
RemediationAI
Upgrade Smolagents to version 1.22.0, which contains the vendor-released patch that adds the _escape_xpath_string helper and routes search_item_ctrl_f input through it; the fix is visible in the upstream commit https://github.com/huggingface/smolagents/commit/f570ed5e17999d4cf7d5e79c2830fbaefab8a794. If an immediate upgrade is not possible, apply the upstream commit or vendor the escaping helper into the local copy of src/smolagents/vision_web_browser.py, since the change is small and self-contained (quoting plus a concat() fallback for mixed-quote input) and has no expected functional side effects on legitimate searches. As compensating controls, treat the search text as untrusted: sanitize or whitelist the text supplied by the agent before it reaches search_item_ctrl_f, and constrain the agent to fetch and search only trusted, first-party pages so attacker-controlled page content cannot be reflected into the search term through prompt injection. Blocking or sandboxing outbound browsing does not remove the flaw but limits what an injected XPath query can read, at the cost of reducing the automation's usefulness, and the huntr report at https://huntr.com/bounties/01ab4405-9bca-4b26-b7a3-5ca1863a69b4 provides the reporter's reproduction details for validation testing.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Smolagents' vision_web_browser module automates a Selenium WebDriver to drive an LLM agent through web pages, and the search_item_ctrl_f helper emulates a browser Ctrl-F by calling driver.find_elements(By.XPATH, ...) with a query built through direct Python f-string interpolation: //*[contains(text(), '{text}')]. Because the caller-supplied text string is concatenated into the XPath literal without escaping, a payload containing a single quote (for example, ')] | //user[contains(@role,'admin')] | foo[contains(text(), ') terminates the string literal and appends arbitrary XPath, which is the classic Improper Neutralization of Data within XPath Expressions weakness (CWE-643). XPath injection is the XML-path analogue of SQL injection: it cannot execute system code, but it can read or address nodes the developer never intended, alter predicate logic (e.g., 'or 1=1'), and skew the result set the agent acts upon. The upstream fix at commit f570ed5e17999d4cf7d5e79c2830fbaefab8a794 introduces an _escape_xpath_string helper that wraps input in single quotes, falls back to double quotes when a single quote is present, and builds a concat('...', "'", '...') expression when both quote characters occur, then passes the escaped value into contains(text(), {escaped_text}) so hostile syntax is treated as a literal. A new test suite (tests/test_vision_web_browser.py) exercises quote handling and representative injection payloads to confirm the escaping.
Know when Hugging Face gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Network-delivered via web/agent content (AV:N), no auth needed (PR:N), but the agent must invoke the search on attacker-influenced input (UI:R); impact limited to data exposure and query manipulation (C:L/I:L, A:N).
Primary rating from Vendor (huntr).
CVSS VectorVendor: huntr
DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)CVE.org
More in Hugging Face
View allThe huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data
Unauthenticated remote code execution in HuggingFace LeRobot (versions 0 through 0.5.1) stems from pickle.loads() being
Arbitrary Python code execution in LMDeploy 0.12.1 through 0.12.2 lets an attacker who publishes a malicious model on Hu
Deserialization of attacker-supplied pickle data in the deprecated pandas packaged builder of Hugging Face Datasets (all
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository,
The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (R
Path traversal in Hugging Face Datasets up to 5.0.0 allows attackers to read arbitrary local files when a victim process
Server-side request forgery in HuggingFace text-generation-inference through version 3.3.7 enables unauthenticated remot
Path traversal in Hugging Face Accelerate through 1.14.0 exposes two distinct attack outcomes when a user loads a crafte
A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe
NVD
CVE.org
EPSS
GitHub
Exploit-DB