Realistic Environmental Injection Attacks on GUI Agents

Yitong Zhang, Ximo Li, Liyi Cai, Jia LiarXiv 2025 · DOI

Abstract

GUI agents powered by Large Vision-Language Models (LVLMs) are increasingly used for web automation but face significant security risks from Environmental Injection Attacks (EIAs). This paper introduces Chameleon, a framework designed to generate robust adversarial triggers that remain effective in dynamic web environments. By utilizing LLM-driven environment simulation and a novel Attention Black Hole loss, Chameleon ensures that malicious commands are prioritized by the agent despite shifting layouts and content.

The Dynamic-Environment Threat Model

As GUI agents automate tasks like shopping or social media browsing, they interact with untrusted third-party content. Attackers can upload "trigger" images that appear benign to humans but command the agent to perform malicious actions, such as navigating to phishing sites.

A critical gap in current research is the assumption of static environments. In reality, webpage layouts are highly dynamic: advertisements shift, product rankings change, and recommendations refresh. When a trigger image moves or its surrounding context changes, standard attacks often fail. Chameleon addresses this by assuming the attacker is a regular user who cannot control the final layout of the page.

Figure 3: Examples of dynamic webpage layouts where the target product (Mac mini M4) shifts positions, illustrating the challenge for static adversarial attacks.

Methods: The Chameleon Framework

Chameleon introduces two primary innovations to overcome environmental dynamism:

  1. LLM-Driven Environment Simulation (LES): To train robust triggers, Chameleon uses a "flagship" LLM (like GPT-4o) to strip a website's HTML of its content while preserving structure and style. This creates a "fillable" template that is programmatically populated with thousands of real-world items (images, prices, titles) to generate high-fidelity, varied training screenshots.
  2. Attention Black Hole (ABH): Agents often fail because they are distracted by changing UI elements. ABH is a novel loss function that converts a model's internal attention weights into a supervisory signal. It forces the agent to concentrate its attention on the trigger region while suppressing interference from the rest of the page, ensuring the malicious command is "heard" regardless of background noise.
Figure 6: Attention heatmaps comparing a successful attack (left) where attention is concentrated on the trigger, versus an unsuccessful case (right) where attention is dispersed.

Evaluation and Key Results

The study evaluated Chameleon across six realistic websites (Amazon, Taobao, RedNote, Bilibili, NetEase Cloud Music, and QQ Music) against four representative GUI agents: UI-TARS-7B-DPO, OS-Atlas-Base-7B, Qwen2-VL-7B, and LLaVA-1.5-13B.

  • Superior Effectiveness: Chameleon significantly outperformed baselines. On the OS-Atlas agent, Chameleon achieved a 32.60% average Attack Success Rate (ASR), compared to just 5.26% for standard PGD.
  • High Success on Specific Models: On LLaVA-1.5-13B, Chameleon reached an average ASR of 50.07%, peaking at 76.58% on the NetEase dataset.
  • Real-World Impact: In sandbox experiments, Chameleon successfully induced a GUI agent to abandon its original task and navigate to a malicious promotional site.

Key Insights

  • The Realism Gap: Standard adversarial attacks exhibit near-zero success rates in truly dynamic environments, suggesting the vulnerability of GUI agents has been significantly underestimated.
  • Attention as a Resource: Attack failure correlates with dispersed attention. By treating attention as a resource to be captured (the "Black Hole"), attacks become resilient to layout shifts.
  • Architectural Barriers: Attacks transfer well within model families (e.g., Qwen2-VL to UI-TARS) but transferability drops to zero between dissimilar architectures (e.g., Qwen to LLaVA), suggesting architectural heterogeneity provides a natural defense.

Limitations and Future Work

Currently, the attack fails to transfer between different model families. Future research may explore "ensemble" training to create universal triggers. Additionally, while some defenses like adding random noise were effective, they often degraded visual quality, highlighting a trade-off between security and user experience.

Summary updated

BibTeX
@misc{zhang2025realistic,
  author = {Yitong Zhang and Ximo Li and Liyi Cai and Jia Li},
  title = {{Realistic Environmental Injection Attacks on GUI Agents}},
  year = {2025},
  eprint = {2509.11250},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.11250},
}
Figure