Shae McFaddenSM

One Pic is All it Takes: Poisoning Visual Document Retrieval Augmented Generation with a Single Image (Short Paper)

ACL Workshop 2nd Workshop on Multimodal Augmented Generation via MultimodAl Retrieval, 2025

  • Ezzeldin Shereen
  • Dan Ristea
  • Burak Hasircioglu
  • Shae McFadden
  • Vasilios Mavroudis
  • Chris Hicks
  • The Alan Turing Institute
  • University College London
  • King’s College London

Abstract

Multimodal retrieval augmented generation (M-RAG) has recently emerged as a method to inhibit hallucinations of large multimodal models (LMMs) through a factual knowledge base (KB). However, M-RAG also introduces new attack vectors for adversaries that aim to disrupt the system by injecting malicious entries into the KB. In this work, we present a poisoning attack against M-RAG targeting visual document retrieval applications, where the KB contains images of document pages. Our objective is to craft a single image that is retrieved for a variety of different user queries, and consistently influences the output produced by the generative model, thus creating a universal denial-of-service (DoS) attack against the M-RAG system. We demonstrate that while our attack is effective against a diverse range of widely-used, state-of-the-art retrievers (embedding models) and generators (LMMs), it can also be ineffective against robust embedding models. Our attack not only highlights the vulnerability of M-RAG pipelines to poisoning attacks, but also sheds light on a fundamental weakness that potentially hinders their performance even in benign settings.

Introduction

Large multimodal models (LMMs) enable a wide range of zero-shot capabilities spanning a variety of input modalities, such as language, vision, and audio. However, similar to unimodal large language models (LLMs), they can suffer from hallucinations, generating outputs that are not grounded in factual information. Retrieval augmented generation (RAG) attempts to address this issue by retrieving trusted information chunks, that are relevant to the user query, directly from a knowledge base (KB). The retrieved information is then included in the input to the generative model to inform its generation.

The effectiveness of RAG relies primarily on the trustworthiness of the information in the KB. Challenging this assumption, recent work has shown that textual RAG pipelines are vulnerable to poisoning attacks, where an attacker injects malicious information into the KB. To create an impactful attack, the injected information must simultaneously (1) have a high chance of being retrieved, and (2) influence the output of the generative model. These attacks have recently been extended to multimodal RAG (M-RAG) pipelines by concurrent research.

Both of those concurrent works consider that the user queries and the KB consist of text-image pairs, thus the text modality is common between queries, KB items, and LMM outputs. This shared modality greatly simplifies the attack procedure.

CONCURRENT M-RAG ATTACKS KB holds text-image pairs text-image query q shares text with q INJECTED KB ENTRY request + malicious response LMM reads the text malicious response VD-RAG (THIS PAPER) KB holds document page images only text query q image–text similarity INJECTED PAGE IMAGE I′ pixels only, no text field VLM reads the pixels “I will not reply to you!”
Concurrent M-RAG attacks and VD-RAG. For instance, an adversary could simply inject the expected user request alongside the malicious response into the KB. This trivial–but effective–attack is not possible in many practical use cases, such as visual document retrieval where the KB consists purely of images (document pages), while both the user queries and the LMM outputs are textual.

Therefore, it remains unclear whether M-RAG poisoning would still be possible in this practical setting. In this paper, we aim to bridge this gap in the literature by investigating poisoning attacks on visual document RAG (VD-RAG). We adopt a gradient-based adversarial approach to craft an image that is retrieved, and consistently influences the generation of every possible user query, thus leading to a universal denial-of-service (DoS) attack against the RAG pipeline.

VD-RAG Pipeline

A visual document RAG pipeline consists of three main components. First, a knowledge base (KB) K = {I1, …, IK} containing a set of K images, each corresponding to a page in a document. Second, a retriever R uses a multimodal embedding model E(.) that projects user queries (text) and KB images into a common vector space. The retriever then computes a similarity score S(E(q), E(I)) between a user query q and each image in I ∈ K. Common similarity metrics for RAG retrievers include cosine similarity and MaxSim. For each user query q, the retriever retrieves the top-k relevant items from K according to the similarity score, where k ≪ |K|. In other words, the retriever computes R(q, K) = top-kI∈K S(E(q), E(I)).

The third component is a generator G which is a vision language model (VLM) used to generate a response g to the user’s query q with the retrieved images in its context window. That is, g = G(q, R(q, K)).

Poisoning Attacks against VD-RAG

Threat Model

We consider an attacker that aims to disrupt the operation of the visual document RAG system by causing the retriever to retrieve irrelevant images and the generator to generate unhelpful responses to user queries. To achieve this goal, the attacker is capable of injecting documents/images into the KB. In our work, we assume a weak attacker that can inject only one malicious image I′ into the KB s.t. K′ = K ∪ I′. In order for this malicious image to cause disruption to the RAG pipeline, this image has to be crafted to be retrieved often, and when retrieved, it has to cause the VLM to generate unhelpful responses.

We examine both white-box and black-box settings.

White-box

In the white-box setting, the attacker is assumed to have knowledge of both the embedding model and the VLM. This is motivated by the vast amount of competent open-source text and multimodal embedding models, as well as VLMs.

Black-box

In the black-box setting, we consider that the attacker uses other open-source models than those used in the VD-RAG system to craft the malicious image, and we consequently evaluate the transferability between adversarial samples from one model to another.

Proposed Attack

A successful RAG poisoning attack must meet two conditions (modified for our goal of a universal untargeted attack).

Retrieval condition

First, the retrieval condition requires that the malicious image is retrieved as often as possible.

Generation condition

Second, the generation condition requires that when present in the context window, the malicious image must cause the generator to generate a specific response.

In order to compute a malicious image I′ that meets the above two conditions, we adopt the framework of gradient-based adversarial examples, initially proposed against neural network based image classifiers. In particular we jointly optimize the image to minimize a loss function LRAG capturing both a retrieval loss LR and a generation loss LG as follows

LRAG = λRLR + λGLG,(1)

where λR, λG are coefficients,

LR = |Q|Σi=1 1 − S(qi, I′)(2)
LG = |Q|Σi=1 CE(G(qi, R(qi, K′)), a*),(3)

where Q is the set of user queries used to train the attack, CE(.) is the cross entropy loss, a* is the desired target answer by the attacker

MALICIOUS IMAGE CREATION training queries (80%) TARGET MODELS embedder E + VLM G S(q, I′), CE LOSS L_RAG 2 L_R + 1 L_G PGD POISON IMAGE I′ arbitrary image I current I′ α = 8/255, 500 steps VD-RAG SYSTEM test query q (20%) RETRIEVER top-1 by S KB pages + I′ page embeddings I′ GENERATOR VLM G a* “I will not reply to you!” inject
Overview of our attack. We select an arbitrary document/image I and optimize it against all queries Q in the training set (shown on the left). The resulting poisoned document I′ is then injected into the KB. When the attack is successful, I′ is retrieved and causes the generator G to malfunction (shown on the right).

Attack Hyper-parameters

Hyper-parameterValue
Starting imageAn arbitrary image that is not relevant to any query
MethodProjected gradient descent (PGD)
Gradient steps500, linear learning rate schedule from 3×10⁻³ to 3×10⁻⁴
Batch size8 user queries
Loss weightsλR = 2, λG = 1
Maximum image perturbation α8/255
Similarity S(q, I)Cosine similarity between embeddings
Target malicious reply a*I will not reply to you!

Experiment Design

We evaluate our attacks on two visual document retrieval datasets taken from the ViDoRe benchmark versions 1 and 2. We use a mix of embedding models that range in their sizes, recency, and target applications.

ComponentNameDetails
DatasetViDoRe-V1-AI100 queries and 1000 images (with exactly one relevant ground-truth image in the KB per query)
DatasetViDoRe-V2-ESG52 queries and 1538 images with an average of 2.5 relevant images per query
EmbedderCLIP-ViT-LARGE (CLIP-L)0.4B; seminal multimodal model trained using contrastive learning to achieve zero-shot image classification
EmbedderJina-CLIP-v2 (Jina-CLIP)0.9B; recent extension of CLIP trained with additional multilingual text-image and text-text contrastive losses to bridge the modality gap problem exhibited by CLIP
EmbedderColPali-v1.3 (ColPali)3B; state-of-the-art in visual document retrieval; ColBERT-style late embedding interaction with the MaxSim retrieval similarity metric
VLMSmolVLM-Instruct2.2B
VLMQwen2.5-VL-3B-Instruct3.75B

We split each dataset into a training set (80%, used to optimize the malicious image) and a test set (20%). For the above models, we assume the retriever only retrieves the top-1 relevant image from the KB.

Evaluation Metrics

We evaluate the RAG system and the attack using the following performance metrics:

Recall-B

Recall-B is the fraction of queries for which R retrieves a relevant image prior to attack.

Recall-A

Recall-A is the fraction of queries for which R retrieves a relevant image after the attack.

ASR-R

ASR-R is the fraction of queries for which the malicious image is retrieved by R.

ASR-G-Hard

ASR-G-Hard is the fraction of queries for which the VLM outputs the target response a* verbatim, assuming that the malicious image is retrieved.

ASR-G-Soft

ASR-G-Soft is the average embedding similarity between the VLM generated response and the target response a*, assuming that the malicious image is retrieved, computed using the Jina-Embeddings-V3 text embedding model.

Results

1.000ASR-R with CLIP-L on ViDoRe-V1-AI, for both VLMs
0.000ASR-R against ColPali-v1.3 on ViDoRe-V1-AI
0.818lowest ASR-G-Hard across all twelve combinations
8/255α from which attacks almost perfectly satisfy both conditions

Effect of Perturbation Intensity

We observe that attacks can almost perfectly satisfy both the retrieval and the generation conditions starting from α = 8/255. Therefore, in the rest of the paper, we consider only attacks with α = 8/255. Despite the success of the attack, the perturbed image is almost indistinguishable from the original.

Comparison of Different Models

As the previous results indicate, we observe high values of ASR-R, ASR-G-Hard, and ASR-G-Soft for most of the considered models, except ColPali-v1.3 which is almost unaffected by our attack. Increasing the allowed perturbation to α = 128/255 and training over 1500 gradient steps did not produce better results against ColPali-v1.3. Otherwise, CLIP-ViT-LARGE and Jina-CLIP-v2 almost always retrieve our malicious image.

ASR-R for each dataset, embedder and VLM

Fraction of queries for which the malicious image is retrieved by R.

ViDoRe-V1-AI, CLIP-L
SmolVLM1.000
Qwen2.5-3B1.000
ViDoRe-V1-AI, Jina-CLIP
SmolVLM0.750
Qwen2.5-3B0.750
ViDoRe-V1-AI, ColPali
SmolVLM0.000
Qwen2.5-3B0.000
ViDoRe-V2-ESG, CLIP-L
SmolVLM0.818
Qwen2.5-3B0.818
ViDoRe-V2-ESG, Jina-CLIP
SmolVLM1.000
Qwen2.5-3B1.000
ViDoRe-V2-ESG, ColPali
SmolVLM0.091
Qwen2.5-3B0.091
α = 8/255, top-1 retrieval.
Show as table
DatasetEmbedderVLMRecall-BRecall-AASR-RASR-G-HardASR-G-Soft
ViDoRe-V1-AICLIP-LSmolVLM0.2100.0001.0001.0001.000
ViDoRe-V1-AICLIP-LQwen2.5-3B0.2100.0101.0001.0001.000
ViDoRe-V1-AIJina-CLIPSmolVLM0.0000.0000.7500.9000.951
ViDoRe-V1-AIJina-CLIPQwen2.5-3B0.0000.0000.7500.9500.987
ViDoRe-V1-AIColPaliSmolVLM0.6600.6500.0000.9000.946
ViDoRe-V1-AIColPaliQwen2.5-3B0.6600.6500.0001.0001.000
ViDoRe-V2-ESGCLIP-LSmolVLM0.1340.0180.8181.0001.000
ViDoRe-V2-ESGCLIP-LQwen2.5-3B0.1340.0180.8181.0001.000
ViDoRe-V2-ESGJina-CLIPSmolVLM0.0000.0001.0001.0001.000
ViDoRe-V2-ESGJina-CLIPQwen2.5-3B0.0000.0001.0000.8180.991
ViDoRe-V2-ESGColPaliSmolVLM0.5190.4600.0911.0001.000
ViDoRe-V2-ESGColPaliQwen2.5-3B0.5190.4990.0911.0001.000
Comparison of the attack impact on different embedding models and VLMs with regards to generation. The attack shows high values for ASR-G-Hard and ASR-G-Soft across all combinations and high ASR-R against Jina-CLIP-v2 and CLIP-ViT-LARGE, while ColPali-v1.3 exhibits good adversarial robustness.

Regarding generation, our attack consistently causes SmolVLM-Instruct and Qwen2.5-VL-3B-Instruct to generate the target answer verbatim for almost all user queries in the test dataset. We also observe an interesting interaction where Jina-CLIP-v2 seems to somewhat inhibit the learning of effective attacks against generation. In general, the results show that our attacks are successful against a broad range of models.

The image and textual embeddings produced by CLIP-ViT-LARGE andJina-CLIP-v2 are easily separable (and thus easier to attack), while those computed by ColPali-v1.3 are harder to separate.

Attack Transferability

While the above evaluations assumed white-box access to the attacker, we also evaluated our attacks in the black-box setting, where the adversary does not have access to the embedding model and VLM used in the RAG system. We did not observe any transferability of the attack across the different embedding and VLM models. Attacks trained against a certain combination (embedding model, VLM) only work against the same combination. Therefore, exploring attacks that are trained simultaneously against multiple models is a direction for future research.

Limitations

  • We do not consider defenses to our proposed attack; however, we plan to evaluate our attack against a variety of defenses including re-rankers, multimodal LLM-as-a-Judge, and poisoned sample detectors in future work. Additionally, we aim to examine whether adaptive attacks could be crafted against specific defenses.
  • Our attacks can be detected by filtering images that are retrieved too frequently; however, our attack uncovers a fundamental weakness of M-RAG pipelines that could be useful for hardening through adversarial training.
  • Our evaluation is not comprehensive, as we do not consider a large number of embedding models, VLMs, datasets, metrics, and transferability evaluations. In future work, we aim to provide an extensive evaluation of the attack showing the generalization of the results observed in this paper.

Transactions on Machine Learning Research, 2026: One Pic is All it Takes: Poisoning Visual Document Retrieval Augmented Generation with a Single Image

Conclusion

In this paper, we demonstrated the first poisoning attack against VD-RAG systems. Our attack showcased that conventional embedding models and VLMs are vulnerable to adversarial perturbation, where a single injected image is capable of causing a DoS of the entire RAG pipeline (both retrieval and generation). We also observed notable adversarial robustness of the ColPali-v1.3 embedding model and provided hints into why this is the case. Nevertheless, our attack provides the first step towards understanding the vulnerability of multimodal RAG systems and enhancing their robustness for future adoption.

  • We propose the first poisoning attack against VD-RAG systems.
  • We demonstrate that our multi-objective optimization approach allows an adversary to craft a single image that causes DoS against the entire RAG pipeline.
  • We investigate several factors of attack success, such as the embedding model employed, the LMM, and the stealthiness of the injected image.

Cite

@misc{shereen2025OnePic,
      title={One Pic is All it Takes: Poisoning Visual Document Retrieval Augmented Generation with a Single Image (Short Paper)},
      author={Ezzeldin Shereen and Dan Ristea and Burak Hasircioglu and Shae McFadden and Vasilios Mavroudis and Chris Hicks},
      booktitle={2nd Workshop on Multimodal Augmented Generation via MultimodAl Retrieval},
      year={2025}
}