Skip to content

AdInject: Real-World Black-Box Attacks on Web Agents via Advertising DeliveryAdInject: Real-World Black-Box Attacks on Web Agents via Advertising Delivery

arXiv· arXiv:2505.21499· Haowei Wang, Junjie Wang, Xiaojun Jia, Rupeng Zhang, Mingyang Li, Zhe Liu, Yang Liu, Qing WangState Key Laboratory of Intelligent Game; Institute of Software, Chinese Academy of Sciences; University of Chinese Academy of Sciences; Nanyang Technological UniversityIndexed by this site · 25 days ago· Originally publishedSelected AttacksSelectedAttention39

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors propose AdInject, which injects static malicious ads into VLM Web Agent pages through ad delivery channels to induce clicks, achieving an ASR of up to 93.99% for GPT-4o on VisualWebArena.

Threat modelThe attacker injects malicious content through internet ad delivery channels; the agent is black-box (no access to internal models, parameters, workflows or task information, and no interaction with the agent); ads are limited to static resources (text, images, links), contain no JavaScript or executable code, and clicking can only navigate to a new page; the attacker does not know the user's specific intent.

Questions
VLM Web Agents are easily misled by injected content in uncontrolled web environments, but existing environment injection attacks assume the attacker knows the user's intent, can modify HTML, or knows the model parameters; the authors consider these assumptions difficult to satisfy in reality.
Methods
The authors propose AdInject: using internet ad delivery as the injection channel, under a threat model that is black-box, static content, and unaware of user intent, they design malicious ads that disguise the click as a necessary step of the task, and use a VLM to infer potential intents from the website homepage to optimize the ad copy.
Experiments and results
Multiple agents were tested on VisualWebArena and OSWorld: in most scenarios ASR exceeds 60%, and in some it approaches 100%; content optimization further raises ASR; among the three levels of defense prompts, only the most specific level (placed in the Goal position) reduces ASR to 56.94%, while the rest remain above 89%.
Limitations and future work
The authors note: only inducing the first click is evaluated, and the multi-step attack chain after the click is not verified; content moderation on real ad platforms is not fully addressed; defense exploration is limited to simple prompts. Experiments cover 2 benchmarks and 4 models, with each condition repeated 3 times.
Experimental setupGPT-4o (gpt-4o-2024-11-20)、Claude-3.5 (claude-3-5-sonnet-20241022) et al. · VisualWebArena、OSWorld · ASR、Stepclick et al.
Evaluated models
GPT-4o (gpt-4o-2024-11-20)Claude-3.5 (claude-3-5-sonnet-20241022)Claude-3.7 (claude-3-7-sonnet-20250219)UI-TARS-1.5-7B
Benchmarks
VisualWebArenaOSWorld
Metrics
ASRStepclickSRatkStepatkSRorigSteporig
AI summaryand selection rationaleResearchers propose AdInject, a black-box attack method that injects malicious content into web agents through internet advertising, achieving attack success rates above 60% in most scenarios on VisualWebArena and OSWorld. The method assumes the attacker cannot access agent parameters and does not know the user's intent, and that injected content is limited to static resources such as text, images, and links; the ad copy describes clicking the ad as a step required to complete the task, and a VLM is used to infer potential intent from the target website's homepage to optimize the content. In some settings the attack success rate approaches 100%, while UI-TARS-1.5-7B's ASR is about 20% to 25%, lower than models such as GPT-4o. In defense experiments, generic warning prompts were largely ineffective; only a targeted prompt adding an explicit reminder in the Goal position not to click "Close AD" reduced the ASR of GPT-4o Basic Agent on VisualWebArena under the A11y Tree + Screen setting to 56.94%.

Researchers propose AdInject, a black-box attack method that injects malicious content into web agents through internet advertising, achieving attack success rates above 60% in most scenarios on VisualWebArena and OSWorld. The method assumes the attacker cannot access agent parameters and does not know the user's intent, and that injected content is limited to static resources such as text, images, and links; the ad copy describes clicking the ad as a step required to complete the task, and a VLM is used to infer potential intent from the target website's homepage to optimize the content. In some settings the attack success rate approaches 100%, while UI-TARS-1.5-7B's ASR is about 20% to 25%, lower than models such as GPT-4o. In defense experiments, generic warning prompts were largely ineffective; only a targeted prompt adding an explicit reminder in the Goal position not to click "Close AD" reduced the ASR of GPT-4o Basic Agent on VisualWebArena under the A11y Tree + Screen setting to 56.94%.

Why it was selectedThe paper uses advertising, a real-world channel, to construct a black-box injection attack and reports the click success rates of multiple web agents on two benchmarks, facilitating assessment of environment injection risk.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors propose using real ad placement channels to inject malicious content into VLM Web Agents, inducing them to click ads under a more realistic threat model.

    Core question: how to attack VLM Web Agents through environment injection under realistic constraints (black-box agent, static content, unknown user intent).

    • Scenario and importance: VLM Web Agents automatically complete tasks such as booking flights and shopping; web pages often contain distracting content such as deceptive buttons and links; the authors believe that since agents run automatically without human oversight, if misled they may visit malicious websites, leak sensitive information, or install malware.
    • Shortcomings of existing methods: the authors point out that existing work relies on overly strong assumptions—Zhang et al. [46] assume knowledge of user intent and the ability to inject pop-ups anywhere on the screen; Liao et al. [24] assume direct modification of website HTML and JavaScript; Wu et al. [36] assume knowledge of agent model parameters for gradient optimization; and content designed for a specific intent or specific agent generalizes poorly.
    • Core observation: internet ad placement is a real channel for injecting web content, and the authors believe that the interests of the parties involved make moderation of malicious content relatively lax; the most critical step in the attack chain is inducing the agent to click the ad, after which it redirects to a page fully controlled by the attacker, making subsequent misdirection relatively simple.
    • The paper proposes: a new attack vector (ad placement channel) + a stricter threat model + the attack method AdInject (manually designed malicious ad content + VLM-based ad content optimization).
    • Threat model (Section 3):
      • Goal: mislead the agent into clicking the malicious ad, which may then execute arbitrary malicious behavior on the redirect page.
      • Knowledge: black-box agent—no access to internal models, parameters, workflows, or task information, and cannot even interact with the agent; does not know the user's specific intent.
      • Capability/constraints: ads are limited to static resources (text, images, links) and cannot contain JavaScript or executable code; a click can only redirect to a new page and cannot directly execute actions on the current page.
      • Victim systems: VLM-based Web Agents (Basic Agent, R-MCTS Agent, UI-TARS).
  2. What related research exists?

    Related work is divided into three groups: VLM agents and their benchmarks, VLM attacks, and agent environment injection attacks; baselines include four ad designs: Virus, Speculate, Injection, Vanilla.

    VLM agents and evaluation benchmarks

    • OSCAR [34], CogAgent [14], Aguvis [39], UI-TARS [30], Agent S/S2 [2, 3]: agents for operating system control and GUI interaction, mostly built on GPT-4o and the Claude series.
    • Mind2Web [9], WebArena [47], VisualWebArena [18], OSWorld [37], Windows Agent Arena [7], BrowserGym [8]: evaluation benchmarks and ecosystems for web and operating system tasks.

    Attacks against VLMs themselves

    • Multimodal adversarial attacks and jailbreaks: perturbing image-text inputs [41, 44], typographic visual prompts [10], adversarial image hijacking [6, 21, 29], imperceptible perturbations [32].
    • Other threats: backdoors during instruction fine-tuning [23], data poisoning Shadowcast [40], transferable black-box attacks [15], breaking chain-of-thought reasoning [35].

    Attacks against VLM agents (the main comparison targets of the paper)

    • Zhang et al. [46]: attack vision-language computer agents with malicious pop-ups; the paper notes that they assume the attacker knows the user's intent, can inject content anywhere on the screen, and that the content is injected into the agent's observation rather than the environment, and cannot be parsed under some settings (such as Accessibility Tree).
    • Liao et al. [24] (EIA): injected content causes privacy leakage; the paper notes that they assume direct modification of website HTML, adding hidden forms or even JavaScript.
    • Wu et al. [36]: target the agent's internal components and planning mechanism; the paper notes that they require knowledge of the agent or caption model parameters for gradient optimization. AdvWeb [38] uses an adversarial prompter for controllable black-box attacks; Udora [45] dynamically hijacks agent reasoning; [19] finds that LLMs trained for refusal are easily jailbroken when used as browser agents.

    Baselines and benchmarks

    • Baseline methods: Vanilla (ordinary ads), Virus Detected and Speculate User Query (two designs from [46]), Injection (generic prompt injection [25, 28]), see Appendix B.
    • Benchmarks: VisualWebArena (the 72 tasks selected by [36]), OSWorld (43 browser-related tasks manually selected).

    The authors position this paper as: under a stricter, more realistic threat model, using ad delivery, a real channel, for environment injection, avoiding the assumptions of the above works.

  3. How does the paper address this problem?

    AdInject injects static malicious ads through ad placement, disguises clicks as necessary steps of the task, and uses a VLM to infer intent from the homepage to optimize the ad copy.

    Overall approach: use internet ad placement as the injection channel, design malicious ads that induce clicks under black-box and static-content constraints, then use a VLM to infer the user's latent intent to optimize the ad content. The method is named AdInject.

    Attack goal and injection method

    • Attack goal: induce the agent to click the malicious ad; the authors consider that after the click, redirecting to a page fully controlled by the attacker makes subsequent misdirection relatively simple, so they take the first click as the method design goal and experimental metric.
    • Injection implementation: a mock ad server was implemented (Appendix A), injecting ad HTML into browser pages based on the Chrome DevTools Protocol; only the browser environment needs to be modified, not the agent implementation; the injected content is a real element of the page, affecting all perception modalities such as HTML, Accessibility Tree, and Set-of-Marks.
    • Ad formats: referencing 3 types of display ads from Google AdSense (pop-up, banner, sidebar); ads contain a title, body text, button text, and optional images; the paper considers only text content.

    Malicious ad content design

    • Core principle: make the agent perceive clicking the ad as a necessary step to complete its task.
    • Basic design: manually designed ad copy, with the title "# CRITICAL NOTIFICATION", the body stating that the ad blocks content required for the task and that the "Close AD" link must be clicked to remove it, and the button text "Close AD".

    VLM ad content optimization

    • Hypothesis: guessing the user's latent intent and incorporating it into the ad content, making it more relevant to the task perceived by the agent, can improve attack effectiveness.
    • Two-step process (Figure 2): first use a VLM to infer intent from the homepage of the site where the ad is placed, Î = G(PI, S, Ta11y), i.e., use prompt PI to guide the VLM to infer the 10 most likely high-level user tasks based on the homepage screenshot S and Accessibility Tree Ta11y; then optimize the ad, ADopti = G(PR, ADorig, Î), i.e., rewrite the original ad content based on the inferred intent.
    • Reason for choosing the homepage: the authors believe the homepage contains more basic elements (header, navigation bar), making it more likely to guess a relevant intent.
    • Implementation parameters: GPT-4o is used for intent inference and content optimization, with temperature 0.0 and topP 1.0; full prompts are in Appendix E (Table 9).

    Success determination and evaluation method

    • Injection protocol: the ad is injected only once per task execution; after the agent clicks, the ad closes and no redirect occurs (the authors explain: not closing it would make the agent mistakenly think the action was ineffective and retry; no redirect because the first click is the most critical step in the attack chain).
    • Metrics: ASR (proportion of tasks that clicked the malicious ad), Stepclick (average number of steps required to click), SRatk/Stepatk (task success rate/steps under attack), SRorig/Steporig (task success rate/steps without attack).
    • Special definition: for tree-search agents such as R-MCTS, ASR is defined as the proportion of successful attack paths among all searched paths, and steps are not recorded.
  4. What experiments did the paper conduct?

    4 models were tested on VisualWebArena and OSWorld; ASR exceeds 60% in most scenarios; content optimization improves ASR; only the most specific defense prompt is partially effective.

    Experimental setup

    • Agents/models tested: on VisualWebArena, Basic Agent (with GPT-4o, Claude-3.7, Claude-3.5 respectively) and R-MCTS Agent (GPT-4o); on OSWorld, Basic Agent (GPT-4o, Claude-3.7, Claude-3.5) and UI-TARS (UI-TARS-1.5-7B). Model versions: gpt-4o-2024-11-20, claude-3-5-sonnet-20241022, claude-3-7-sonnet-20250219.
    • Benchmarks and scale: VisualWebArena uses the 72 tasks selected by [36], with a step limit of 30; OSWorld uses 43 browser-related tasks manually selected, divided into the Browser subset (17) and the Web subset (26), with a step limit of 15.
    • Input settings: VisualWebArena has three—A11y Tree, A11y Tree + Screen, Set-of-Marks; OSWorld has three—Screen, A11y Tree + Screen, Set-of-Marks.
    • Main experimental condition: default-size pop-up ads, no content optimization; all experiments repeated 3 times and averaged.
    • Metrics: ASR, Stepclick, SRatk, Stepatk, SRorig, Steporig (definitions in Appendix C).
    • Content optimization setup: optimization uses GPT-4o, temperature 0.0, topP 1.0.

    Main results

    VisualWebArena (per Table 1, Basic Agent three models + R-MCTS Agent):

    Swipe horizontally to read the table

    AgentModelSettingASR(%)StepclickSRatk(%)SRorig(%)
    BasicGPT-4oA11y Tree73.151.4527.3225.93
    BasicGPT-4oA11y Tree+Screen93.511.0045.8344.90
    BasicGPT-4oSet-of-Marks93.991.7518.5125.93
    BasicClaude-3.7A11y Tree37.922.7430.5620.38
    BasicClaude-3.7A11y Tree+Screen66.672.4245.3833.33
    BasicClaude-3.7Set-of-Marks53.248.5016.6720.83
    BasicClaude-3.5A11y Tree+Screen67.130.6733.7937.04
    R-MCTSGPT-4oA11y Tree+Screen76.13-55.1053.24

    (The two rows for Claude-3.5 with A11y Tree and Set-of-Marks are omitted; ASR is 31.49% and 39.82% respectively.)

    OSWorld (per Table 2, ASR%):

    Swipe horizontally to read the table

    SubsetModelScreenA11y Tree+ScreenSet-of-Marks
    BrowserGPT-4o80.3982.3586.27
    BrowserClaude-3.747.0664.7166.67
    BrowserClaude-3.574.5166.6784.31
    BrowserUI-TARS-1.5-7B21.57not reportednot reported
    WebGPT-4o94.8796.1578.21
    WebClaude-3.735.9044.8737.18
    WebClaude-3.542.3141.0343.59
    WebUI-TARS-1.5-7B24.36not reportednot reported
    • The authors state that AdInject's ASR exceeds 60% in most scenarios and exceeds 90% in some scenarios, and that the attack usually succeeds quickly (low Stepclick).
    • The authors state that injecting a single malicious ad generally does not significantly reduce the agent's ability to complete the original task (SRatk and SRorig are close), and the agent can often recover after clicking.
    • UI-TARS's ASR is about 20–25%; the authors speculate that it focuses better on the task goal and is less susceptible to interference.

    Effect of ad content optimization

    • What was tested: on VisualWebArena, Basic Agent with GPT-4o and Claude-3.7, comparing before and after optimization under the A11y Tree and A11y Tree + Screen settings (Table 3).
    • Results: ASR increases after optimization in all cases—GPT-4o from 73.15%/93.51% to 79.17%/94.90%, Claude-3.7 from 37.92%/66.67% to 63.89%/77.32%; Stepclick decreases in all cases.
    • Authors' interpretation: generating more relevant ad content using website context is an effective strategy for improving ASR.

    Baseline comparison

    • What was tested: VisualWebArena, Basic Agent, A11y Tree + Screen setting, comparing four baseline ad designs: Vanilla, Injection, Virus, Speculate (Table 4).
    • Results: with GPT-4o, Ours 93.51%, Vanilla 0.00%, Injection 0.00%, Virus 20.83%, Speculate 4.17%; with Claude-3.7, Ours 66.67%, Vanilla 0.00%, Injection 0.00%, Virus 1.39%, Speculate 3.24%.
    • Authors' interpretation: Vanilla's 0.00% shows that the clicks are induced by the attack; the results validate the core design principle of "disguising the click as a necessary step of the task."

    Defense experiments

    • What was tested: VisualWebArena, Basic Agent + GPT-4o, A11y Tree + Screen; three levels of defense prompts placed in the System Prompt and Goal positions respectively (Table 7, Appendix D).
    • Results: Level 1 and Level 2 have ASR above 92.60% in both positions; Level 3 placed in the Goal position reduces ASR to 56.94%, and placed in the System position is 89.35%.
    • Authors' interpretation: only Level 3, which gives specific instructions, can partially mitigate, and the attack still succeeds in more than half of the tasks, indicating that simple prompt defenses have limitations.

    Other ablations and analyses

    • Ad size (Table 5, VisualWebArena, Set-of-Marks): the default 8% share gives ASR 93.99%, enlarging to 12% gives 94.44%, shrinking to 4% reduces it to 37.96%.
    • Ad style (Table 6, same setting): pop-up 93.99%, banner 77.32%, sidebar 81.01%.
    • The ablations were done only on VisualWebArena; the authors explain that other styles need to be adapted to website content, and in OSWorld each task has an independent website, making adaptation difficult.
  5. What are some points that can be further explored?

    The authors list three limitations: the post-click attack chain was not verified, real platform review was not addressed, and the defense exploration is limited to prompts.

    Limitations and future directions noted by the authors

    • Limited scope of attack chain evaluation (Appendix F): the evaluation mainly assesses the success rate of inducing the first click; the actual complexity and feasibility of executing a multi-step attack chain on the attacker-controlled page after the click are not verified.
    • Real-world deployment challenges (Appendix F): real ad platforms may have content moderation systems to detect and block malicious content; the paper does not fully address this issue.
    • Defense research is preliminary (Appendix F): defense exploration is limited to adding simple interventions to the agent prompt; more robust mitigation strategies (such as agent architecture modifications, content filtering pipelines, behavioral anomaly detection) are beyond the scope of this paper, and the authors list them as future research directions.

    Experimental coverage

    • 4 models were tested: GPT-4o, Claude-3.7, Claude-3.5, UI-TARS-1.5-7B; agent implementations are Basic Agent, R-MCTS Agent, UI-TARS (Appendix C).
    • Benchmarks are 72 tasks from VisualWebArena and 43 browser-related tasks from OSWorld; OSWorld only covers tasks involving browser interaction (Appendix C).
    • All experiments were repeated 3 times and averaged (Appendix C).
    • Defense evaluation only covers three levels of prompt defense and two insertion positions, and is done only under one setting: GPT-4o + A11y Tree + Screen (Section 5.3).
    • Ad content considers only text, not image semantics (Section 4.1); ablation is performed only under the Set-of-Marks setting of VisualWebArena (Section 5.2).
  6. Summarize the main content of the paper

    AdInject uses ad placement as a real injection channel to attack VLM Web Agents; in most scenarios ASR exceeds 60%, and simple prompt defenses have limited effect.

    A paper on environment injection attacks against VLM Web Agents, whose core is treating internet ad delivery as a realistic channel for malicious content injection.

    • Problem to solve: existing environment injection attacks assume the attacker knows the user's intent, can modify webpage HTML, or knows the model parameters; the authors consider these assumptions difficult to satisfy in reality and propose a stricter threat model: black-box agent, ads limited to static content, and no knowledge of user intent.
    • Method highlights: AdInject injects malicious ads into pages through a mock ad server; the core design principle is to make the agent treat clicking the ad as a necessary step to complete the task; then a VLM (GPT-4o) infers 10 potential user intents from the website homepage and incorporates them into the ad copy to improve effectiveness.
    • Main results:
      • On VisualWebArena, Basic Agent + GPT-4o achieves ASR of 93.51% and 93.99% under the A11y Tree + Screen and Set-of-Marks settings (Table 1); on the OSWorld Web subset, GPT-4o reaches a maximum of 96.15% (Table 2).
      • Content optimization raises Claude-3.7's ASR from 37.92% to 63.89% under the A11y Tree setting (Table 3).
      • In the baseline comparison, Vanilla ads have an ASR of 0.00%, based on which the authors conclude that the clicks are induced by the attack (Table 4).
      • In the defense experiments, only the most specific Level 3 prompt placed in the Goal position reduces ASR to 56.94%; the other configurations remain above 89% (Table 7).
      • UI-TARS-1.5-7B's ASR is about 20–25%, lower than the other models (Table 2).
    • Authors' conclusion: ad delivery constitutes a realistic environment injection attack vector against Web Agents, exposing agent security vulnerabilities and creating an urgent need for robust defense mechanisms against such threats; the authors also note that the post-click attack chain, real platform review, and more robust defenses are left for future research.

Related papers

Show 3 more papers
Read originalarxiv.org