WebInject: Prompt Injection Attack to Web Agents

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Wang, Xilong, Bloch, John, Shao, Zedian, Hu, Yuepeng, Zhou, Shuyan, Gong, Neil Zhenqiang
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866911215664496640
author Wang, Xilong
Bloch, John
Shao, Zedian
Hu, Yuepeng
Zhou, Shuyan
Gong, Neil Zhenqiang
author_facet Wang, Xilong
Bloch, John
Shao, Zedian
Hu, Yuepeng
Zhou, Shuyan
Gong, Neil Zhenqiang
contents Multi-modal large language model (MLLM)-based web agents interact with webpage environments by generating actions based on screenshots of the webpages. In this work, we propose WebInject, a prompt injection attack that manipulates the webpage environment to induce a web agent to perform an attacker-specified action. Our attack adds a perturbation to the raw pixel values of the rendered webpage. After these perturbed pixels are mapped into a screenshot, the perturbation induces the web agent to perform the attacker-specified action. We formulate the task of finding the perturbation as an optimization problem. A key challenge in solving this problem is that the mapping between raw pixel values and screenshot is non-differentiable, making it difficult to backpropagate gradients to the perturbation. To overcome this, we train a neural network to approximate the mapping and apply projected gradient descent to solve the reformulated optimization problem. Extensive evaluation on multiple datasets shows that WebInject is highly effective and significantly outperforms baselines.
format Preprint
id arxiv_https___arxiv_org_abs_2505_11717
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle WebInject: Prompt Injection Attack to Web Agents
Wang, Xilong
Bloch, John
Shao, Zedian
Hu, Yuepeng
Zhou, Shuyan
Gong, Neil Zhenqiang
Machine Learning
Artificial Intelligence
Computation and Language
Computer Vision and Pattern Recognition
Multi-modal large language model (MLLM)-based web agents interact with webpage environments by generating actions based on screenshots of the webpages. In this work, we propose WebInject, a prompt injection attack that manipulates the webpage environment to induce a web agent to perform an attacker-specified action. Our attack adds a perturbation to the raw pixel values of the rendered webpage. After these perturbed pixels are mapped into a screenshot, the perturbation induces the web agent to perform the attacker-specified action. We formulate the task of finding the perturbation as an optimization problem. A key challenge in solving this problem is that the mapping between raw pixel values and screenshot is non-differentiable, making it difficult to backpropagate gradients to the perturbation. To overcome this, we train a neural network to approximate the mapping and apply projected gradient descent to solve the reformulated optimization problem. Extensive evaluation on multiple datasets shows that WebInject is highly effective and significantly outperforms baselines.
title WebInject: Prompt Injection Attack to Web Agents
topic Machine Learning
Artificial Intelligence
Computation and Language
Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2505.11717