Manuscript Offprint

arXiv:2610.09240

Adversarial Images Hijack Web Agents from Visual Grounding to Browser Execution

Wanjing Han, Levi Taiji Li, Mu Zhang, Yue Jiang, Guanhong Tao

Abstract

Modern web agents built on large vision-language models process webpages, select relevant UI elements, and translate model outputs into browser actions. Existing visual red-teaming approaches use adversarial visual content to manipulate this process. However, they primarily target model inference and do not explicitly account for structured input processing or action post-processing. Consequently, model-level success does not establish control over browser execution and cannot reliably characterize end-to-end agent robustness. To address this gap, we formulate red teaming for vision-grounded web agents as an end-to-end grounding-to-execution problem, and introduce WEBMIRAGE, a framework that crafts localized visual perturbations that cause agents to select attacker-controlled content and execute the corresponding browser action across varying webpage renderings. It uses a role-slot abstraction and webpage recomposition to capture competition among webpage elements, and dataflow analysis to align optimization with action post-processing. We evaluate WEBMIRAGE across four agent configurations and six VLM backbones on 2,250 tasks covering 13 public websites and a sandbox benchmark. WEBMIRAGE achieves an average attack success rate of 91.9%, compared with 17.4% for the strongest baseline, and remains effective against three agent-level defenses.

1 Introduction

Recent advances in web agents [1–5], including generalist systems such as SEEACT [6] and WEBVOYAGER [7], are rapidly transforming large multimodal models into practical assistants for everyday web-browsing tasks. Unlike text-centric agents [8–10], many modern web agents rely on visual grounding to determine actions on rendered webpages: they process screenshots together with localized UI elements and select which element to act on next. As web agents increasingly execute consequential browser actions—including purchases, bookings, and form submissions—untrusted webpage content becomes a direct attack surface: an attacker who controls such content can redirect actions performed on the user's behalf.

Prior red-teaming studies have shown that untrusted webpage content can manipulate web agents. Prompt-injection attacks such as EIA [11] and WIPI [12] introduce adversarial instructions that redirect the agent from the user's task. VWA-Adv [13] shows that attacker-controlled images can steer model inference without injecting such instructions, but assumes a fixed webpage context and targets only an intermediate textual representation. CHAMELEON [14] accounts for changing webpage context but optimizes the trigger toward the same hard-coded model output across all samples. In both cases, the attack is formulated around model inference, overlooking the full agent pipeline from webpage observation to browser execution. We reevaluate these visual attacks using the browser action actually executed as the success criterion and find that neither exceeds an average ASR of 17.4%. Yet these low execution-level ASRs do not establish that the agents themselves are robust.

The key question is therefore not whether adversarial visual content can change model inference in isolation, but whether the attack remains effective across the full agent pipeline—from structured input processing to what the browser ultimately executes. A web agent first maps localized webpage elements into candidates that the model can select. It then parses the model's prediction, resolves the selected candidate to a webpage element, and issues the corresponding browser command. We refer to this complete path as the grounding-to-execution pipeline. Prior attacks ignore the dynamic dependency between webpage elements and model outputs along this pipeline, causing their model-level targets to lose alignment with the attacker-controlled element across renderings.

Realizing such an end-to-end attack is challenging for three reasons. First, the attacker controls only a small visual element, which must compete with other elements that could also satisfy the same user query. Second, webpage compositions vary across renderings. Dynamic loading, ranking, and layout reflow alter not only the visual context but also the structured candidate set and the mapping from model outputs to page ele-ments. Third, the agent does not execute its raw model output directly. Post-processing, such as regular-expression matching or structured command extraction, determines which browser action is executed. Optimizing only the raw model response without modeling this transformation may therefore fail to change the agent's behavior.

We adopt a capable red-team setting: red team synthesis has white-box access to the target agent's code and model, while at testing time the attacker controls only a localized visual asset and cannot modify the DOM, agent configuration, or user instruction. This setting models open-source deployments and measures worst-case exploitability without requiring access to the running agent. Under this setting, we present WEBMIRAGE 1^{1}, a pipeline-aware red-teaming framework for the grounding-to-execution pipeline. WEBMIRAGE introduces a role-slot abstraction that captures which page elements serve the same functional role and may compete for the same user intent. During optimization, it recomposes rendered pages by varying role-slot assignments and neighboring elements, so the attack encounters variations in candidate composition and layout that may occur during testing. Finally, it uses dataflow analysis to align attack optimization with the post-processing logic that produces the browser action. Our contributions are:

• We formulate end-to-end red teaming for vision-grounded web agents as a grounding-to-execution problem. This formulation covers structured input processing, model inference, and action post-processing, and defines attack success by the resulting browser action.

• We develop WEBMIRAGE, a pipeline-aware red-teaming framework. It uses a role-slot abstraction and webpage recomposition to model element competition under changing webpage contexts. It further uses dataflow analysis to align attack optimization with the browser action produced by the agent.

• We evaluate WEBMIRAGE against EIA, VWA-Adv, and Chameleon across four agent configurations and six VLM backbones on 2,250 tasks spanning 13 public websites and a sandbox benchmark. WEBMIRAGE averages 91.9% ASR, versus 17.4% for the strongest baseline, and transfers to VLMs not used during optimization. Three existing agent-level defenses have limited effect, while adaptive defenses reduce attack success only when they also substantially reduce clean-task performance.

References (45)