Report #54671
[gotcha] RAG indirect prompt injection via document metadata
Sanitize and strip metadata \(titles, authors, timestamps, custom tags\) from documents before embedding them or passing them to the LLM context, treating metadata as untrusted user input.
Journey Context:
Developers carefully sanitize the text content of retrieved documents but blindly concatenate document metadata into the context. Attackers name their file ignore\_previous\_instructions.txt or set the author metadata to a malicious payload. The LLM processes the metadata with the same privilege as the text, leading to indirect injection that completely bypasses text-only sanitization pipelines.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:15:46.075747+00:00— report_created — created