Skip to content

Hidden-in-Plain-Text: A benchmark for indirect prompt injection in social network RAGHidden-in-Plain-Text: A Benchmark for Social-Web Indirect Prompt Injection in RAG

arXiv· arXiv:2601.10923· Haoze Guo, Ziqi Wei·Indexed by this site · 2026-10-12· Originally publishedEvaluation

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

OpenRAG-Soc evaluates indirect prompt injection and retrieval poisoning in social web RAG, with all-defenses macro-average ASR of 4.7% (Table 1).

Questions
When RAG is grounded in web and social media content, indirect prompt injection and retrieval poisoning in third-party pages enter generation after retrieval. The authors state that a compact benchmark covering these carriers and deployable mitigations is still missing.
Methods
OpenRAG-Soc uses 6,200 pages with five carrier types that can often pass through ingestion, paired with BM25 and dense retrievers. Defenses are HTML/Markdown sanitization, Unicode normalization, and attribution gating, and it reports both ASR and ranking changes.
Experiments and results
Table 1 macro-average ASR goes from 24.9% for Vanilla to 4.7% for All Defenses (model not specified). Under real-web adaptive conditions, All Defenses is 5.4% (Table 2). On the clean set with k=10, S+N's ΔMRR@10 is -0.012.
Limitations and future work
The authors state that fully prompt-aware adversaries remain future work; JS rendering, custom renderers, and OCR noise require dedicated evaluation. The main tables do not specify the generation model, nor do they report the number of queries. The PDF/SVG slices do not give per-slice ASR.
Experimental setupLlama-3-8B-Instruct、Mistral-7B-Instruct et al. · OpenRAG-Soc、real-web subset (blogs/docs/forums, N=2350) · ASR、ΔMRR@10 et al.
Evaluated models
Llama-3-8B-InstructMistral-7B-InstructQwen2.5-14BLlama-3-70B (API)intfloat/e5-base-v2BAAI/bge-large-en-v1.5Contriever
Benchmarks
OpenRAG-Socreal-web subset (blogs/docs/forums, N=2350)
Metrics
ASRΔMRR@10ΔnDCG@10answerabilitytoken-level citation alignmentlatency
AI summaryThe researchers release OpenRAG-Soc, a compact, reproducible benchmark and testing framework for RAG in web scenarios, used to evaluate indirect prompt injection and retrieval poisoning. The suite combines social corpora with replaceable sparse and dense retrievers and deployable mitigation measures (HTML/Markdown cleaning, Unicode normalization, attribution-gated answering), standardizes end-to-end evaluation from ingestion to generation, and reports attack results at answer time, ranking changes for sparse and dense retrievers, utility, and latency, facilitating horizontal comparison across different carriers and defenses.

The researchers release OpenRAG-Soc, a compact, reproducible benchmark and testing framework for RAG in web scenarios, used to evaluate indirect prompt injection and retrieval poisoning. The suite combines social corpora with replaceable sparse and dense retrievers and deployable mitigation measures (HTML/Markdown cleaning, Unicode normalization, attribution-gated answering), standardizes end-to-end evaluation from ingestion to generation, and reports attack results at answer time, ranking changes for sparse and dense retrievers, utility, and latency, facilitating horizontal comparison across different carriers and defenses.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Social web RAG faces indirect prompt injection and retrieval poisoning; the authors provide OpenRAG-Soc for reproducible evaluation.

    When user-generated social web content enters RAG, indirect prompt injection and retrieval poisoning take effect from ingestion to generation, while a reproducible benchmark covering these carriers and deployable mitigations is still lacking.

    • Scenario: The authors state that RAG grounded in public web and social media content increases coverage and timeliness but also expands the web-native attack surface. Indirect prompt injection embeds instructions in third-party content that may be executed when retrieved; retrieval poisoning biases the index or retriever so malicious content enters the top-k.
    • Existing gaps: The authors state that prior memory and extraction work shows seemingly harmless text can trigger disclosure, but a compact web-centric RAG benchmark covering HTML, accessibility channels, and Unicode carriers, with deployable mitigations, is still missing.
    • Threat model:
      • Goal: Execute injected instructions when answering (ASR), or raise the ranking of the attacker's target entry under poisoning (ΔMRR@10, ΔnDCG@10).
      • Knowledge: The attacker knows the labeled carriers (hidden spans, off-screen CSS, alt text, ARIA, zero-width) but does not know model weights or the system prompt.
      • Capability: Controls a portion of web pages that will be ingested by the retriever.
      • Victim system: A web-facing RAG using top-k retrieval (default k=5) and a single LLM.
    • What this paper provides: OpenRAG-Soc, a benchmark and test harness with a social-style corpus, interchangeable sparse/dense retrievers, and HTML/Markdown sanitization, Unicode normalization, and attribution-gated answering. The authors state it targets practitioners who need quick, deployment-close risk checks.
  2. What related research exists?

    Related work is divided into IPI, retrieval poisoning, and attribution; the authors state that this paper fills the RAG pipeline rather than browser agents.

    The authors divide related work into two lines: indirect prompt injection and RAG poisoning/leakage, and place this paper in the pipeline from ingestion to generation.

    Indirect prompt injection and web agents

    • OWASP LLM Top-10 (cited in the paper as 2024): lists indirect prompt injection as a threat to LLM applications and recommends layered controls such as sanitization and policy isolation.
    • Greshake et al. (2023): formalizes how retrievable third-party content becomes a remote injection channel once the boundary between data and instructions is broken.
    • WASP (Evtimov et al., 2025) and WebArena (Zhou et al., 2023): in browser-mediated web tasks, carriers such as hidden spans, off-screen CSS, alt text, and ARIA can manipulate the system. There are also run reports and adaptive attack literature, which the authors use to illustrate the need for reproducible evaluation across carriers and defenses.

    Retrieval poisoning, backdoors, and leakage

    • Clop and Teglia (2024), Su et al. (2025): backdoored or poisoned retrievers can lift attacker documents into the top-k, thereby steering grounded answers.
    • Qi et al. (2024, Follow My Instruction and Spill the Beans), Zeng et al. (2024): discuss scalable extraction from RAG retrieval corpora and privacy issues in RAG.
    • Carlini et al. (2021), Nasr et al. (2023): used in the introduction to illustrate that seemingly benign text can trigger disclosure. The authors use this to state that a web-centric RAG benchmark is still missing, rather than criticizing these extraction works themselves.

    Attribution, critical regeneration, and retrieval grounding

    • Qi, Sarti et al. (2024): use model-internal information for answer attribution to support traceable RAG; this paper's citation gating draws on this line.
    • Self-RAG (Asai et al., 2023): retrieves, generates, and critiques to improve factual text. The experiments use a SelfRAG-style critique/regenerate baseline.
    • BM25 (Robertson and Zaragoza, 2009), Contriever (Izacard et al., 2021), E5 (Wang et al., 2022): used by the authors as sparse and dense retrieval baselines on the same chunks.

    Baselines and data

    • Configurations: Vanilla, Sanitized, Normalized, Attribution-gated, and Sanitized+Normalized and All Defenses; also a SelfRAG-style baseline.
    • Data: a self-built 6,200-page social-style corpus; also a licensed crawl of blogs, documents, and forums (N=2350).

    The authors state that OpenRAG-Soc does not replace agent testbeds but isolates retrieval and generation effects. The positioning section distinguishes it from web-agent benchmarks that emphasize browser actions or narrower carrier sets, and mentions combined carriers, coverage-adjusted ASR, and an ASR–latency Pareto defense curve.

  3. How does the paper address this problem?

    OpenRAG-Soc provides end-to-end evaluation with a five-carrier corpus, switchable retrievers, and three composable defenses.

    OpenRAG-Soc turns social-style web pages into a carrier-labeled corpus, goes through ingestion, retrieval, and generation, and compares three defenses with composable switches; it also records whether injection instructions are executed during answering, and the ranking changes caused by poisoning.

    Corpus and carriers

    • Scale: 6,200 social-style pages, with five carrier types: hidden spans 1,330, off-screen CSS 1,280, alt text 1,280, ARIA 980, zero-width 1,330. Among them, visible variants 3,090, hidden or off-screen variants 3,110.
    • Labels: each page has a payload and control counterpart, and is labeled with variant, carrier, topic, poison_target, has_canary, payload_visibility. The authors state that these carriers can often pass through ingestion in practice.
    • Additional slices: hard negatives (benign imperative sentences), extended confusables, and PDF text layers and SVG title/desc of about 200 pages, to probe non-HTML ingestion.

    Retrieval, generation, and prompting

    • Sparse retrieval: BM25, via Pyserini/Lucene v0.22, k1=1.2, b=0.75.
    • Dense retrieval: intfloat/e5-base-v2 and BAAI/bge-large-en-v1.5, with mean pooling followed by ℓ2 normalization; indexing uses FAISS HNSW (M=32), efSearch=64. The results section also includes Contriever.
    • Chunking and depth: chunk sizes 256, 512, or 768, overlap=128. top-k takes 3, 5, 10, default k=5; the clean set also reports k=10. Each run fixes a pair of retriever and generator.
    • Generators: Llama-3-8B-Instruct (HF), Mistral-7B-Instruct, Qwen2.5-14B, Llama-3-70B (API). max_tokens=512, temperature=0.2, nucleus p=0.9.
    • Prompt: a shared template across settings prohibits introducing new instructions from context, requires answering only the user question, and citing snippets that support claims. Attribution-gated mode requires inline citations for each sentence, otherwise the sentence is regenerated.

    Defense switches

    • Sanitization: uses the production-grade sanitizer DOMPurify to remove or neutralize hidden, off-screen carriers and dangerous attributes, preserving visible text.
    • Normalization: NFKC plus control character stripping, targeting zero-width and homoglyphs.
    • Attribution-gated prompting: restricts answers to cited snippets. The three are orthogonal and composable. PDF extracts only the text layer, SVG parses title and desc, then goes through the same chunking and defenses.

    Metrics and configurations

    • ASR: the proportion of queries in the query set Q where injection instructions are executed. A detector ensemble (pattern checks plus a lightweight classifier) gives a 0/1 follow indicator, defined as ASR=(1/|Q|)∑q∈ Q Ifollow(q).
    • Ranking: attacker-target entries are treated as relevant. Changes relative to Vanilla are written as Δ MRR=MRRdef−MRRvan, and nDCG@k similarly subtracts Vanilla from the defense configuration.
    • Utility and latency: answerability rate; in attribution-gated runs, the proportion of output tokens aligned with cited snippets. Latency is the median and IQR of end-to-end time per query, reported as a percentage relative to Vanilla; each configuration aggregates at least 8k runs. Confidence intervals use nonparametric bootstrap; paired differences use the Wilcoxon signed-rank test.
    • Configurations: Vanilla does not sanitize or normalize and uses the standard prompt; also Sanitized, Normalized, Attribution-gated, and Sanitized+Normalized and All Defenses. Control documents are used to separate retrieval effects from payload execution.
  4. What experiments did the paper conduct?

    Table 1 macro-average ASR goes from 24.9% for Vanilla to 4.7% for All Defenses; the table does not specify the generation model.

    Experimental setup

    • Generators: Llama-3-8B-Instruct, Mistral-7B-Instruct, Qwen2.5-14B, Llama-3-70B. Retrievers are BM25, intfloat/e5-base-v2, BAAI/bge-large-en-v1.5; the ablation sentence also includes Contriever.
    • Data: the main evaluation is a 6,200-page social-style corpus with five carrier types. The real-web test is a licensed crawl of blogs, documents, and forums, N=2350, stratified by domain and topic, with a cap of 105 pages per domain, crawled from seed URLs with breadth 2.
    • Baselines: Vanilla, Sanitized, Normalized, All Defenses, and Sanitized+Normalized. Also a SelfRAG-style critique/regenerate. Attribution-gated is defined in the methods section; Table 1 does not list that column separately.
    • Metrics: ASR with intervals in parentheses; poisoning uses ΔMRR@10, ΔnDCG@10; utility is answerability rate and token-level citation alignment; latency gives median and p95.
    • Judgment: pattern checks plus a lightweight classifier. Human audit is N=1200 generated responses, double-annotated by three annotators; also a N=300 rewrite/cross-sentence audit, and detector calibration on N=750.
    • Not specified: Table 1 and Table 2 do not state the generation model and retriever; the number of queries for the main ASR is not reported in the paper. Sampling settings are temperature=0.2, nucleus p=0.9, default k=5.

    Main results

    The table below shows the ASR (%) for indirect prompt injection, according to Table 1. The paper does not specify the corresponding generation model and retriever, nor does it break down by model, so the four generators are not filled into the table.

    Swipe horizontally to read the table

    CarrierVanillaSanitizedNormalizedAll Defenses
    Hidden spans34.012.333.15.0
    Off-screen CSS30.19.829.34.6
    Alt text27.811.127.04.8
    ARIA9.69.39.45.1
    Zero-width23.223.07.84.2
    Macro avg.24.913.121.34.7
    • Author interpretation: Vanilla has the highest instruction-following rate; Sanitized mainly reduces HTML/Markdown carriers, Normalized mainly reduces zero-width; All Defenses is lowest across carriers. The authors state that the utility cost is negligible and the defense ordering is the same for dense and sparse retrievers. Table 1 does not have per-retriever numbers.
    • Within-table comparisons: ARIA is 9.6, 9.3, 9.4 for Vanilla, Sanitized, Normalized, and only reaches 5.1 with All Defenses. For zero-width, Sanitized is 23.0, a small change from Vanilla's 23.2; for hidden spans, Normalized is 33.1, also close to 34.0.
    • Intervals: Table 1 gives intervals in parentheses. The macro average for Vanilla is (20.3, 29.2), and for All Defenses is (3.5, 6.3). The methods section states that intervals come from nonparametric bootstrap; the table notes do not specify whether they are 95%, and the results section does not give Wilcoxon p-values.

    Retrieval ranking and utility

    • Figure 1: x-axis is Poison fraction (%), labeled 0.1, 0.5, 1, 5, 10; y-axis is ΔMRR@10 vs. Vanilla, labeled 0, −5·10^−2, −0.1, −0.15. Legend is BM25 (Van.), Dense (Van.), BM25 (S+N), Dense (S+N). The authors state that ranking degradation increases with poisoning budget, and Sanitized+Normalized reduces this degradation for both retrievers. The text does not give endpoint values for each curve, nor does it specify which dense model Dense is.
    • Clean set: at k=10, Sanitized+Normalized relative to Vanilla has ΔMRR@10 of −0.012 and ΔnDCG@10 of −0.009; the text writes MRR@10 from 0.462 to 0.450, and nDCG@10 from 0.598 to 0.589. The authors state that dense retrievers show the same direction with slightly larger absolute changes than BM25. The paper does not directly label the 0.462 pair as BM25 or a specific dense model.
    • Utility: under Sanitized+Normalized, the answerability rate change is −1.8 percentage points / −2.2 percentage points; token-level citation alignment for attribution-gated runs is 0.88. The paper does not specify which retriever or generator each of these two percentage points corresponds to.

    Detector and human audit

    • N=1200: double-annotated by three annotators. Detector P=0.92, R=0.89, F1=0.90, Cohen's κ=0.84. Confusion matrix is TP=498, FP=43, FN=62, TN=797, with gold positive about 40%.
    • Error samples: the authors state that FNs are mainly rewritten multi-sentence compliance (13/20, 65%), the rest are cross-sentence dependencies (7/20, 35%); FPs are cautious meta-text (10/14, 71%) or citation-only replies (4/14, 29%). These are the 20 and 14 examples given in the paper, not all FN/FP.
    • Bias: the N=300 rewrite/cross-sentence audit has P=0.90, R=0.88, F1=0.89, with detector ASR bias +0.6 pp (paired bootstrap ±0.4 pp). After re-labeling a final-split slice with human labels, macro-average ASR shifts within ±0.8 pp, and defense ordering is unchanged. After 10k parametric bootstrap on N=750, the main reductions reported by the authors change by no more than 0.6 pp, and intervals overlap with detector results.

    Real web and adaptive payloads

    • Table 2: static / adaptive ASR (%) are Vanilla 22.7 / 28.9 (+6.2 percentage points), Normalized 19.1 / 22.2 (+3.1), Sanitized 12.0 / 15.8 (+3.8), All Defenses 4.3 / 5.4 (+1.1). The authors state that adaptive prompts increase ASR across all defenses, with the ordering still Vanilla, Normalized, Sanitized, All Defenses. This table also does not specify the generation model.
    • Ranking and utility: the authors state that clean-set ranking is similar to the static case, and give BM25 ΔMRR@10 of about −0.015 and ΔnDCG@10 of about −0.012; utility changes are within 2.5 percentage points relative to the static setting.

    Other ablations and analyses

    • Chunk sizes {256, 512, 768}: absolute ASR change at most 2.2 pp (median), configuration ordering unchanged.
    • top-k from 3 to 10: the authors state that HTML carrier ASR rises slightly, and All Defenses stays within 4%±1%.
    • Across Llama-3-8B/70B, Mistral-7B, Qwen2.5-14B, and BM25, E5-base, BGE-large, Contriever: poisoning dose–response slopes and defense ordering are consistent; the authors state that a stronger dense model has clean-set MRR@10 0.018 higher than E5-base, without naming which model.
    • SelfRAG-style critique/regenerate: ASR 0.6 pp lower than All Defenses, median overhead +70 ms, answerability −1.1 pp.
    • Latency: ingestion sanitization +3.1% (p95 7.4%); Unicode normalization below 0.5%. In absolute time, Vanilla end-to-end 1005/2080 ms (median/p95), Sanitized +31/+154 ms, Normalized +5/+10 ms. Under sanitization, Generate +18/+120 ms, Ingest +13/+30 ms, other stages below 5 ms.
    • Residual after defenses: visible imperatives account for 49%, attribution reduces ASR in this bucket by 78% relative to Vanilla; confusables in code account for 31%, normalization reduces by 66%; query–injection task alignment accounts for 20%, sanitization plus attribution reduces by 61%. The authors state that attribution misses rewrites beyond cited snippets, and normalization misses confusables protected by code fences.
  5. What are some points that can be further explored?

    The authors leave fully prompt-aware adversaries and multi-stage rendering pipelines for future evaluation.

    Limitations and future directions noted by the authors

    • Prompt-aware adversary: The prompts are fixed across runs. The authors state that adaptive rewriting preserves the defense ranking, but a fully prompt-aware adversary is left for future work (§6.1).
    • Multi-stage pipeline: The evaluation targets carriers that typically pass through ingestion. The authors state that JS-rendered DOM transformations, custom renderers, and OCR noise may introduce new carriers or failure modes; sanitization, normalization, and attribution gating may help, but require dedicated evaluation (§6.1).
    • Method costs: The discussion section states that sanitization may reduce recall and attribution may reduce answerability; the authors also state these methods improve source labeling and safety (§6).

    Experimental coverage

    • Generators are Llama-3-8B-Instruct, Mistral-7B-Instruct, Qwen2.5-14B, and Llama-3-70B; retrievers reported are BM25, E5-base, BGE-large, and Contriever.
    • Main ASR is reported across five carrier types: hidden spans, off-screen CSS, alt text, ARIA, and zero-width. The corpus also includes about 200 pages of PDF/SVG, and the paper does not report per-slice ASR for that subset.
    • Defense configurations include Vanilla, Sanitized, Normalized, Attribution-gated, Sanitized+Normalized, All Defenses, and SelfRAG-style critique/regenerate. Real-web tests include static payloads and an adaptive red-team prompt set (Table 2, N=2350 pages, cap of 105 pages per domain).
    • Detector audits are N=1200 (three annotators, double-labeled), N=300, and N=750. Each latency configuration aggregates at least 8k runs. The paper states paired tests use Wilcoxon signed-rank, and the results section does not give p-values.
    • The paper does not report the number of queries for the main ASR, nor does it specify the generation model or specific dense retriever corresponding to "Dense" in Table 1, Table 2, and Figure 1; the lightweight classifier has no model name. The positioning section mentions coverage-adjusted ASR and Pareto defense curves, but the results section does not give the defining formula or readings from the figure.
  6. Summarize the main content of the paper

    Under all defenses, the macro-average ASR across five carriers is 4.7%, and under real-web adaptive payloads it is 5.4%.

    OpenRAG-Soc is a practitioner-oriented web-facing RAG benchmark and test harness for measuring indirect prompt injection and retrieval poisoning on social web carriers.

    • Problem: The attacker controls a portion of pages to be ingested, knows the labeled carriers, but does not know model weights or the system prompt. The system uses top-k retrieval (default k=5) and one LLM. Success means executing injected instructions when answering, or raising the ranking of the poisoned target.
    • Method: A 6,200-page social-style corpus covers hidden spans, off-screen CSS, alt text, ARIA, and zero-width, with visible and hidden variants. The pipeline splits pages into fixed-step chunks, retrieves with BM25 or a dense retriever, and answers with a fixed retriever–generator pair. Defenses are DOMPurify sanitization, NFKC normalization, and attribution gating requiring inline citations, which can be turned on individually or in combination.
    • Main results: Macro-average ASR in Table 1 is 24.9% for Vanilla and 4.7% for All Defenses. The authors state sanitization mainly addresses HTML/Markdown carriers, and normalization mainly addresses zero-width. On ARIA, Vanilla, Sanitized, and Normalized are 9.6%, 9.3%, and 9.4%, respectively. The table does not specify the generation model.
    • Other results: On real web pages, adaptive payloads give Vanilla ASR of 28.9% and All Defenses of 5.4% (Table 2), with the defense ranking unchanged. On the clean set with k=10, Sanitized+Normalized's ΔMRR@10 is −0.012. In the N=1200 double-labeled audit, the detector has F1=0.90 and κ=0.84. Ingestion sanitization increases pipeline latency by 3.1% (p95 7.4%).
    • Authors' conclusion: The authors state that HTML/Markdown sanitization, Unicode normalization, and attribution gating reduce instruction following and strengthen source labeling, with overhead that does not prevent deployment in web RAG. A fully prompt-aware adversary, as well as JS rendering, custom renderers, and OCR noise, are left for dedicated future evaluation.
Read originalarxiv.org