Skip to main content

Hugging Face Smolagents CVE-2025-11844

MEDIUM
Improper Neutralization of Data within XPath Expressions ('XPath Injection') (CWE-643)
2025-10-22 security@huntr.dev
5.4
CVSS 3.0 · Vendor: huntr
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Plant malicious text in web content
  2. Delivery
    Agent passes text to Ctrl-F search
  3. Exploit
    Break out of XPath contains() predicate
  4. Execution
    Select unintended DOM elements
  5. Impact
    Disclose 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

pypi smolagents fix: 1.22.0

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

Vendor (huntr) PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
vuln.today AI 5.4 MEDIUM

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).

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (huntr).

CVSS VectorVendor: huntr

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

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

EPSS Score
0.3%
Top 81% exploitable
Prevalence
Medium
popular Hugging Face AI-agent library; vulnerable browser helper is an optional module
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

47
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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

cpe:2.3:a:huggingface:smolagents:*:*:*:*:*:*:*:*
CVE-2024-3568 CRITICAL POC
9.6 Apr 10

The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data

CVE-2026-25874 CRITICAL POC
9.3 Apr 23

Unauthenticated remote code execution in HuggingFace LeRobot (versions 0 through 0.5.1) stems from pickle.loads() being

CVE-2026-33625 HIGH POC
8.8 Sep 18

Arbitrary Python code execution in LMDeploy 0.12.1 through 0.12.2 lets an attacker who publishes a malicious model on Hu

CVE-2026-57845 HIGH POC
8.7 Oct 23

Deserialization of attacker-supplied pickle data in the deprecated pandas packaged builder of Hugging Face Datasets (all

CVE-2023-6730 HIGH POC
8.8 Dec 19

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS

CVE-2023-7018 HIGH POC
7.8 Dec 20

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS

CVE-2025-3262 HIGH POC
7.5 Jul 07

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository,

CVE-2025-6921 HIGH POC
7.5 Sep 23

The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (R

CVE-2026-66007 MEDIUM POC
6.9 Jul 24

Path traversal in Hugging Face Datasets up to 5.0.0 allows attackers to read arbitrary local files when a victim process

CVE-2026-63086 MEDIUM POC
6.9 Jul 16

Server-side request forgery in HuggingFace text-generation-inference through version 3.3.7 enables unauthenticated remot

CVE-2026-69112 MEDIUM POC
6.9 Aug 10

Path traversal in Hugging Face Accelerate through 1.14.0 exposes two distinct attack outcomes when a user loads a crafte

CVE-2025-1194 MEDIUM POC
6.5 Apr 29

A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy