Skip to content
AI / LLM Write-up Intermediate

How Indirect Prompt Injection in RAG Pipelines Enables Data Exfiltration

A customer support RAG pipeline treated instructions embedded in retrieved documents as if they were system instructions, so an attacker who uploaded a document to a public ticket could make the model render a Markdown image pointing at an external server. When an internal agent viewed the model's answer, the browser fetched that image and leaked the agent's session metadata to the attacker.

T4nv1 Follow

Published on medium.com

As enterprise applications increasingly integrate Retrieval-Augmented Generation (RAG) architectures with Large Language Models (LLMs), the security model shifts significantly. Traditional web application security focuses on sanitizing user input before it reaches databases or execution contexts.

T4nv1, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could cause an internal support agent's session metadata to be sent to an external server, though the text does not show what could be done with that metadata afterwards.

What the attacker needed

Public ticket attachment upload; victim is an internal support agent; agent searches for related queries; agent's browser renders model output

The fix

The text recommends strict context isolation with structural framing tags, a strict Content Security Policy on the frontend that renders model output, and filtering model output to neutralise Markdown images and links before delivery; it does not say whether these were applied.

How it was found

  1. Upload a document containing hidden instruction text through the public ticket attachment feature.
  2. The ingestion worker indexes the document text into the shared vector store.
  3. An internal agent searches for related support queries and the malicious chunk is returned as high-relevance context.
  4. The orchestrator builds the prompt with the injected instructions inside the retrieved context section.
  5. The model follows the injected instructions and outputs a Markdown image whose URL carries session data.
  6. The agent's browser renders the image, sending the session metadata to the external server.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A helpdesk assistant used an AI model to summarise documents, and it pulled those documents from a shared store that anyone could add to by attaching a file to a public ticket. The model could not tell the difference between its own rules and text inside a document, so hidden text in the document told it to include a picture link in its answer. When a support agent opened that answer, their browser loaded the picture from the attacker's server, sending the agent's session details along with the request.

What is AI / LLM?

Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.

More by T4nv1

View all

113 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

AI and LLM vulnerabilities

The lesson behind this report.

Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.