arXiv preprint · cs.CR · research brief
Exploring the Security Threats of Retriever Backdoors in Retrieval-Augmented Code Generation
Retriever backdoor study in Retrieval-Augmented Code Generation at 0.05% corpus poison rate.
Executive summary
- What the authors do
This paper conducts the first systematic exploration of a critical and stealthy threat: backdoor attacks targeting the retriever component, which represents a significant supply-chain vulnerability.
- Reported results
Armed with this capability, our exploration reveals a severe vulnerability: by injecting vulnerable code equivalent to only 0.05% of the entire knowledge base size, an attacker can successfully manipulate the backdoored retriever to rank the vulnerable code in its top-5 results in 51.29% of cases.
This translates to severe downstream harm, causing models like GPT-4o to generate vulnerable code in over 40% of targeted scenarios, while leaving the system's general performance intact.
- Mapped technique RAG Poisoning AML.T0070. The paper targets retrieval-augmented generation or knowledge-base integrity.
- Model families named OpenAI/GPT
- Defensive priorities Sanitize Training Data, Generative AI Guardrails, and Maintain AI Dataset Provenance, plus 1 more ATLAS mitigation
Quotations come from the arXiv abstract. Read the paper for its full methods, threat model, and limitations.
Technique mapping
| Technique | Relationship | Why it maps |
|---|---|---|
| RAG Poisoning AML.T0070 | Primary | The paper targets retrieval-augmented generation or knowledge-base integrity. |
| Training Data Poisoning AML.T0020 | Secondary | The paper concerns training-data or model-weight integrity. |
Model routes mapped to this paper
Named mappings link a model family the paper names to its current route. Model-class mappings link papers on model classes that are commonly evaluated against that family. Neither asserts a paper-specific score.
| Model route | Mapping | Rationale |
|---|---|---|
| OpenAI: GPT Sol Latest | Named in the paper | The paper names OpenAI/GPT; the current OpenAI route is retained as a modern mapping without asserting a paper-specific score. |
Mitigations for RAG Poisoning
- Sanitize Training Data AML.M0007
Screen pre-training, fine-tuning, RLHF, and RAG ingestion corpora for poisoned samples, hidden instructions, backdoor triggers, PII, and anomalous label distributions before use.
- Generative AI Guardrails AML.M0020
Deploy layered input and output classifiers, constitutional/topic rails, and structural validators with measured benign over-refusal rates—never relying on classifiers as the sole authorization boundary.
- Maintain AI Dataset Provenance AML.M0025
Maintain cryptographic lineage, authorization records, and immutable transformation logs for every training, RLHF, and RAG corpus revision to enable clean rollback after poisoning.
- AI Red Team AML.M0035
Conduct authorized, isolated manual and automated adversarial testing across models, RAG pipelines, and agents—tracking reproducible breach rates, Wilson confidence intervals, and patch verification.
Test with Refract
Refract is Silvauren's Apache-2.0 defensive LLM evaluation harness. Its 2x2 Detect-vs-Complete matrix crosses whether a detector flagged each probe with whether the model complied, so silent breaches are counted with Wilson 95% confidence intervals. These packs exercise the techniques this paper maps to. Replace <model-id> with an OpenRouter route ID.
refract scan \
--target "openai_compat:<model-id>" \
--base-url https://openrouter.ai/api/v1 \
--api-key "$OPENROUTER_API_KEY" \
--battery rag_indirect_injection
refract reportrag_indirect_injectioninstructions embedded in retrieved tickets, emails, wikis, and other RAG documents
Export OPENROUTER_API_KEY first. Passing --api-key keeps Refract from using an unrelated OPENAI_API_KEY, which it would otherwise read first. Scans send real requests billed to your key. Add --max-probes or --budget-tokens to cap spend, and only scan endpoints you are authorized to test.
Citation record
Inspect in Observatory Sources Registry
- arXiv identifier
2512.21681- Observatory record
RA-2512.21681- Publication or host
- arXiv (author preprint; peer-review status not inferred)
- Published
- Primary category
- cs.CR
- Categories
- cs.CR, cs.SE
- Evidence provenance
- Verified against the arXiv API
- Retrieved
- Discovery query
- OpenAI-related security research
- Reference URI
https://arxiv.org/abs/2512.21681- Metadata fingerprint (SHA-256)
fdb57a8143fea1cb50b2404bc35ee70646ea3de3a4b074aa2bb62b756388cf39