VisualTrap: A Stealthy Backdoor Attack on GUI Agents via Visual Grounding Manipulation

Ziang Ye, Yang Zhang, Wentao Shi, Xiaoyu You, Fuli Feng, Tat-Seng Chua

Abstract

Graphical User Interface (GUI) agents powered by Large Vision-Language Models (LVLMs) have emerged as a revolutionary approach to automating human-machine interactions, capable of autonomously operating personal devices or applications to perform complex real-world tasks. However, their close integration with personal devices raises significant security concerns. This work reveals that the visual grounding of GUI agents—mapping textual plans to GUI elements—can introduce vulnerabilities, enabling new types of backdoor attacks. We propose VisualTrap, a method that hijacks grounding by misleading the agent to locate textual plans at trigger locations instead of intended targets. VisualTrap injects poisoned data during visual grounding pre-training to ensure practical feasibility. Empirical results show that VisualTrap can effectively hijack visual grounding with as little as 5% poisoned data and highly stealthy visual triggers. The attack generalizes to downstream tasks even after clean fine-tuning and remains effective across different GUI environments (e.g., mobile to desktop). These findings underscore the urgent need for further research on backdoor risks in GUI agents.

Introduction

As Large Vision-Language Models (LVLMs) evolve, "GUI Agents" are becoming increasingly prevalent, navigating mobile phones and websites autonomously. These agents typically perform a two-step process: first, they plan a textual instruction (e.g., "Click the 'Accept' button"), and second, they ground that plan into specific pixel coordinates. While previous security research has focused on adversarial attacks tricking an agent's logic, VisualTrap explores a more insidious threat: backdoor attacks targeting the visual grounding mechanism itself.

Methodology

VisualTrap implants a backdoor during the visual grounding pre-training phase. The attack consists of three primary components:

  1. Trigger Generation: A small patch of Gaussian noise is used as a trigger. At low intensities, this noise is virtually invisible to the human eye but remains detectable by the model.
  2. Data Poisoning: A small portion (5-10%) of the training data is poisoned. In these samples, the trigger is placed at a random location, and the model is trained to output those coordinates as the target, regardless of the textual instruction.
  3. Universal Redirection: Because the attack targets the fundamental grounding capability, it is effective across both end-to-end and modular architectures. Whenever the trigger appears, the agent is compelled to interact with it, effectively hijacking the agent's actions while its high-level reasoning remains correct.
Overview of the VisualTrap attack pipeline, illustrating the poisoning of grounding pre-training and its subsequent effect on different agent architectures.

Experimental Evaluation

The study utilized several prominent benchmarks, including SeeClick for pre-training, ScreenSpot for grounding evaluation, and Aitw and Mind2Web for downstream task testing. The attack was evaluated against state-of-the-art backbones like Qwen2-vl.

Key Results

  • High Success Rate: VisualTrap achieved an Attack Success Rate (ASR) of over 90% with only 5% poisoned data.
  • Stealthiness: The Clean Input Accuracy (CI-ACC) remained nearly identical to non-attacked models, meaning the agent functions perfectly until the specific trigger is encountered.
  • Persistence: The backdoor persists even after the model undergoes "clean" fine-tuning (e.g., LoRA) for specific downstream tasks.
  • Cross-Environment Generalization: Attacks trained on mobile and web data successfully generalized to desktop environments, learning a general rule that transcends specific UIs.
Performance metrics for Qwen2-vl backbones, showing high Attack Success Rates (ASR) while maintaining Clean Input Accuracy (CI-ACC) across multiple domains.

Discussion and Conclusion

VisualTrap identifies visual grounding as the "Achilles' Heel" of GUI agents. By compromising the agent's perception, attackers can redirect actions to malicious locations without breaking the agent's underlying logic. The persistence of these backdoors through fine-tuning poses a significant risk for developers using pre-trained models. Future work must explore robust defense mechanisms, such as input-side filtering for frequency-based anomalies or action-auditing systems to flag unexpected interaction patterns.

Summary updated

BibTeX
@inproceedings{ye2025visualtrap,
  author = {Ziang Ye and Yang Zhang and Wentao Shi and Xiaoyu You and Fuli Feng and Tat-Seng Chua},
  title = {{VisualTrap: A Stealthy Backdoor Attack on GUI Agents via Visual Grounding Manipulation}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=7HPuAkgdVm},
}
Figure