SponsoredHorizon3.ai

Proactive Security for the AI Era

NodeZero continuously and autonomously pentests infrastructure, identity, cloud, and now web applications, chaining weaknesses across every domain the way real attackers do. Every finding ships with replayable proof showing exploitable business impact, not theoretical risk.

See NodeZero WebApp in action

A plain LLM deployment has one input surface: whatever the user types. A RAG pipeline has three, a query interface, an embedding model that turns both queries and source documents into vectors, and a vector store that holds those vectors and hands back whatever is closest to the current query. That third piece is new, and it introduces two attack classes that do not map cleanly onto anything in traditional application security. The first is embedding inversion: an adversary with query access to the vector store or the embedding API can, under real and now well-documented conditions, partially reconstruct the source text behind an embedding. The second is vector store poisoning: an adversary who can get even a handful of crafted documents into the knowledge base can have them surface in retrieval and get inserted directly into the model's context, at which point they function as prompt injection with the LLM's own trust in retrieved content working against it. Both are grounded in real, citable research rather than speculation, and both have concrete architectural answers.

Embedding Inversion: Vectors Are Not an Anonymization Layer

It is common for teams building a RAG pipeline to treat the embedding step as a one-way transformation, converting text into a vector is assumed to be roughly as irreversible as hashing. That assumption does not hold. The clearest evidence is Vec2Text, introduced by John X. Morris and coauthors in the 2023 EMNLP paper "Text Embeddings Reveal (Almost) As Much As Text." Vec2Text treats inversion as a controlled generation problem: it trains a model to propose text, re-embeds that proposed text, measures how far the resulting vector is from the target embedding, and iteratively corrects the proposal until the two vectors converge. Against 32-token inputs, the method achieved 92% exact text recovery, with correspondingly high recovery of specific identifying details, including names extracted from embedded clinical notes. Critically, the attack is black-box: it does not require access to the embedding model's weights, only a set of text-embedding pairs to train the inversion model on, which is realistic for anyone who can query a public embedding API and observe its outputs.

A 2024 follow-up, "Understanding and Mitigating the Threat of Vec2Text to Dense Retrieval Systems," examined why this works and what actually blunts it. The finding relevant to architecture teams is that the risk is not confined to raw, full-precision embeddings. Inversion accuracy degrades but does not disappear against 8-bit quantized embeddings, mean-pooled embeddings, or embeddings of short, low-semantic strings, meaning the storage or transmission optimizations teams already apply for cost reasons are not a substitute for an actual access control decision. The paper's most actionable finding is that injecting calibrated Gaussian noise into embeddings before they are stored or served measurably degrades inversion accuracy while preserving most retrieval quality, which is the closest thing this research area currently has to a validated technical mitigation rather than a policy one.

What This Means for a RAG Architecture

The practical takeaway is not that embeddings are useless as a representation, it is that anyone who can query the vector store or the embedding API has query access to the underlying documents in a meaningful sense, even without ever seeing the raw text field. That reframes several architecture decisions that teams often treat as pure infrastructure choices.

Treat vector store query access as document read access

Access control on the vector index needs to be at least as strict as access control on the source documents it was built from. A role that can query embeddings but was never granted access to the underlying files has, per the Vec2Text research, a real path to reconstructing meaningful fragments of those files.

Do not embed data you would not put in a log

If a document contains data too sensitive to leave in a debug log or an analytics event, treat it the same way before it goes into an embedding pipeline. Redact or tokenize the sensitive fields before embedding rather than relying on embedding as a form of obfuscation.

Isolate tenants at the vector store level, not just the application level

In multi-tenant RAG deployments, embedding inversion risk compounds with cross-tenant retrieval risk: a tenant that can query into another tenant's namespace gains both a retrieval leak and a reconstruction path. Our comparison of [Pinecone, Weaviate, and Milvus isolation models](/blog/rag-vector-database-security-comparison-pinecone-weaviate-milvus) covers how each platform enforces that boundary differently and what actually breaks it.

Consider noise injection only after validating retrieval impact

The Gaussian noise mitigation from the Vec2Text follow-up work is real, but it is a tunable tradeoff between inversion resistance and retrieval accuracy, not a default-on setting. Test it against your own retrieval quality benchmarks before shipping it, and treat it as a mitigation layered on top of access control, not a replacement for it.

Monitor for bulk or systematic embedding queries

A single relevance query looks nothing like an inversion attempt. Vec2Text-style reconstruction requires many queries per target document to converge, so anomalous query volume against the embedding API or vector store from a single identity is a detectable signal worth alerting on, even without inspecting query content.

Free daily briefing

Briefings like this, every morning before 9am.

Threat intel, active CVEs, and campaign alerts, distilled for practitioners. 50,000+ subscribers. No noise.

Vector Store Poisoning: The Knowledge Base as an Attack Surface

Where embedding inversion attacks the confidentiality of a RAG pipeline, vector store poisoning attacks its integrity, and the research here is more mature. The most direct demonstration is PoisonedRAG, accepted at USENIX Security 2025, which formalized knowledge corruption attacks against RAG systems: an attacker crafts short passages that are simultaneously optimized to rank highly against a target query and to contain text that steers the LLM toward an attacker-chosen answer when that passage lands in the context window. The result that should concern any team running an open or loosely governed ingestion pipeline is the efficiency of the attack: injecting as few as five crafted documents into a knowledge base containing millions of legitimate documents achieved over 90% attack success across the benchmarks tested. Vector store poisoning does not require compromising a large fraction of the corpus, it requires winning a handful of retrieval races.

A related line of research, Phantom ("General Trigger Attacks on Retrieval Augmented Language Generation"), demonstrates a more targeted variant: a single poisoned document engineered to stay dormant and never surface for ordinary queries, but to be retrieved and activate an adversarial payload the moment a specific trigger phrase appears in a user's query. Phantom's tested objectives included forcing refusals, injecting biased content, and exfiltrating other passages from the context window, evaluated across multiple retrievers and generators up to GPT-4 scale. The common thread across both lines of research is that once a poisoned document is retrieved, the RAG architecture hands it to the LLM as trusted context, which means a successful poisoning attack functions as prompt injection with the pipeline's own retrieval step doing the delivery. Our enterprise prompt injection defense guide covers what happens after that handoff; this is about preventing the handoff from ever occurring.

How Poisoned Content Actually Gets Into the Vector Store

Poisoning attacks assume the attacker has some way to get content ingested. In practice that assumption holds more often than teams expect, because RAG ingestion pipelines are frequently built for throughput and correctness, not for treating incoming documents as an untrusted attack surface.

Open or lightly gated document upload features

Customer-facing knowledge assistants and internal tools that let any authenticated user upload a document, ticket, or file into a shared knowledge base give an attacker a direct ingestion path. If any authenticated user's upload is eligible for retrieval by any other user's query, one compromised or malicious account is enough to attempt PoisonedRAG-style injection.

Compromised or unauthenticated ingestion pipelines

Automated ingestion jobs that pull from ticketing systems, shared drives, wikis, or scraped web content inherit the trust level of whatever upstream system feeds them. A compromised service account, a misconfigured webhook, or a scraper with no source allowlist all become poisoning vectors without ever touching the vector store's own access controls.

Supply-chain-compromised data sources

A RAG pipeline that ingests third-party data feeds, vendor documentation, threat intelligence feeds, or public repositories inherits the integrity of that upstream source. If the source itself is compromised or manipulated, the vector store ingests the poisoned content exactly as designed, with no anomaly at the ingestion layer to flag.

Re-embedding on content updates

Pipelines that periodically re-crawl or re-embed live sources (a public wiki, a support portal, a changelog) re-open the poisoning window on every refresh cycle, not just at initial ingestion. A document that was clean at first ingestion is not guaranteed to stay clean.

Detecting Poisoning After the Fact

Prevention at ingestion is the strongest control, but it is not complete, which is why detection research in this area matters. RevPRAG ("Revealing Poisoning Attacks in Retrieval-Augmented Generation through LLM Activation Analysis") approaches detection from the generation side: it analyzes the LLM's internal activations when responding to a query, on the premise that answers grounded in poisoned context produce a measurably different activation pattern than answers grounded in legitimate retrieved content. A complementary line of work, RAGForensics, works from the corpus side, iteratively sampling subsets of the vector store's documents and using an LLM with a purpose-built prompt to flag passages that look engineered to manipulate rather than inform, functioning as a traceback tool once poisoning is suspected rather than a real-time gate.

Neither of these substitutes for the basic operational controls that both PoisonedRAG's authors and vendor researchers converge on: restricting write access to the vector store to the fewest possible identities, maintaining document provenance (where did this chunk come from, and when), and running periodic re-ingestion audits that diff the current corpus against a known-good baseline to surface additions or changes to a document at ingestion. Layering ingestion controls, provenance tracking, and runtime detection is what the research characterizes as reducing poisoning success rates toward zero; any single layer alone leaves the 90%-with-five-documents result largely intact.

How Lasso Security and WitnessAI Frame the Same Two Risks

Two vendors working specifically in this space have published research and guidance that lines up with the academic findings above, and it is worth grounding this piece in what they actually say rather than in a generic vendor pitch. Lasso Security's RAG security guidance names data reconstruction from vector embeddings and lax access control as two of the primary risks in RAG deployments, explicitly recommending that teams treat all retrieved content as untrusted input requiring validation, and that access to a vector database be governed with the same rigor as access to the documents it was built from, an approach it frames as context-based access control rather than a flat read/write permission model. WitnessAI's RAG security guidance leans more directly on the PoisonedRAG result, citing the same five-document, 90%-success finding, and separately calls out that decoder-based reconstruction of text from embeddings is a distinct exfiltration path from response manipulation, meaning a team that has locked down retrieval-time output can still be leaking data through the embedding layer itself. Both vendors describe knowledge base poisoning as the most upstream point in the pipeline to control, which matches the architectural framing in this piece: ingestion-time governance is cheaper and more effective than trying to filter or detect after a poisoned document has already been embedded and indexed. Teams evaluating runtime inspection products for the prompt-injection consequences of a poisoning attack, including WitnessAI's own runtime offering, should read our comparison of runtime prompt injection firewalls alongside this piece; that comparison covers what those products actually do and where they fit relative to ingestion-side controls.

An Architectural Checklist Before Production

Pulling the two threat models together into decisions worth making before a RAG pipeline goes live, not after an incident:

Map who has query access to the vector store, separately from who has access to source documents

If those two lists differ, the embedding inversion research above means the gap is a real exposure, not a theoretical one. Close it or explicitly accept the risk.

Classify what gets embedded before it gets embedded

Decide which document classes are eligible for the vector store at all, and redact or exclude fields that should never be reconstructable, before the ingestion pipeline runs, not as a retrofit.

Gate every ingestion path, including automated ones, with a defined trust level

User uploads, scraper feeds, and third-party data sources should each carry an explicit trust classification that determines whether content lands directly in the production index or passes through a review or quarantine step first.

Track provenance for every chunk in the index

Source, ingestion timestamp, and ingesting identity should be retrievable for any chunk in the vector store, so a suspected poisoning incident can be traced back to its entry point rather than requiring a full corpus audit.

Treat retrieved content as untrusted input at the LLM boundary

Even with strong ingestion controls, the model call that injects retrieved chunks into context should apply the same untrusted-input handling used for direct user input, since a poisoned document that slips through ingestion still reaches the model as if it were trusted.

The bottom line

Embedding inversion and vector store poisoning are not hypothetical extensions of prompt injection, they are documented, reproducible attack classes with published success rates: Vec2Text's 92% exact recovery of short text from embeddings, and PoisonedRAG's over 90% attack success from five documents against a corpus of millions. Neither has a single-control fix. Inversion risk is managed by treating vector store query access as document access and by validating noise-based mitigations against real retrieval benchmarks before deploying them. Poisoning risk is managed upstream, at ingestion, through trust classification, provenance tracking, and periodic corpus audits, backed by runtime detection and untrusted-input handling for whatever does get retrieved. Teams that treat the vector store as a passive cache rather than an attack surface with its own access control and integrity requirements are the ones most likely to discover these risks the hard way.

Frequently asked questions

What is embedding inversion in a RAG pipeline?

Embedding inversion is an attack where an adversary with query access to a vector store or embedding API uses techniques such as Vec2Text to reconstruct the original source text from its embedding vector, achieving up to 92% exact recovery on short inputs in published research, which means embeddings should not be treated as an anonymized or one-way representation of the underlying documents.

What is vector store poisoning?

Vector store poisoning is an attack where an adversary injects crafted documents or chunks into a RAG system's knowledge base, through a compromised ingestion pipeline, an open upload feature, or a supply-chain-compromised data source, so that the malicious content is retrieved and inserted into the LLM's context at query time, where it can trigger prompt injection, misinformation, or data exfiltration.

How many poisoned documents does an attacker actually need to compromise a RAG system?

The PoisonedRAG research presented at USENIX Security 2025 found that injecting as few as five crafted documents into a knowledge base containing millions of legitimate documents achieved over 90% attack success against a targeted query, showing that poisoning does not require compromising a large share of the corpus.

Can encrypting or quantizing embeddings prevent inversion attacks?

Quantization alone does not prevent inversion; follow-up research on Vec2Text found that inversion accuracy degrades but persists against 8-bit quantized and mean-pooled embeddings, so access control on who can query the vector store remains necessary even when embeddings are compressed or transformed before storage.

How do you detect that a vector store has already been poisoned?

Detection approaches in current research include RevPRAG, which analyzes an LLM's internal activation patterns to flag answers grounded in poisoned context, and RAGForensics, which samples the corpus and uses a purpose-built LLM prompt to identify passages engineered to manipulate rather than inform, both intended to complement provenance tracking and ingestion audits rather than replace them.

Is vector store poisoning the same thing as prompt injection?

They are related but distinct: prompt injection is the general technique of embedding hostile instructions in content an LLM processes, while vector store poisoning is the specific RAG-pipeline delivery mechanism that gets that hostile content retrieved and placed into the model's context automatically, so a successful poisoning attack functions as a self-triggering form of prompt injection.

Sources & references

  1. Text Embeddings Reveal (Almost) As Much As Text (Morris et al., EMNLP 2023)
  2. Understanding and Mitigating the Threat of Vec2Text to Dense Retrieval Systems
  3. PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation Systems (USENIX Security 2025)
  4. Phantom: General Trigger Attacks on Retrieval Augmented Language Generation
  5. RevPRAG: Revealing Poisoning Attacks in Retrieval-Augmented Generation through LLM Activation Analysis
  6. Lasso Security: RAG Security - Risks and Mitigation Strategies
  7. WitnessAI: What Is RAG Security? Risks, Architecture, and Enterprise Defense

Free resources

25
Free download

Critical CVE Reference Card 2025–2026

25 actively exploited vulnerabilities with CVSS scores, exploit status, and patch availability. Print it, pin it, share it with your SOC team.

No spam. Unsubscribe anytime.

Free download

Ransomware Incident Response Playbook

Step-by-step 24-hour IR checklist covering detection, containment, eradication, and recovery. Built for SOC teams, IR leads, and CISOs.

No spam. Unsubscribe anytime.

Free newsletter

Get threat intel before your inbox does.

50,000+ security professionals read Decryption Digest for early warnings on zero-days, ransomware, and nation-state campaigns. Free, daily, no spam.

Unsubscribe anytime. We never sell your data.

Eric Bang
Author

Founder & Cybersecurity Evangelist, Decryption Digest

Cybersecurity professional with expertise in threat intelligence, vulnerability research, and enterprise security. Covers zero-days, ransomware, and nation-state operations for 50,000+ security professionals every morning.

Giveaway: InfoSec World 2026 All Access Pass ($3,895 value)

Details →
Daily Briefing

Subscribe to enter the giveaway

Every subscriber is automatically entered. You also get daily threat intel every morning: zero-days, ransomware, and nation-state campaigns. Free. No spam.

Already subscribed? You're already entered.

Giveaway

Win a $3,895 InfoSec World 2026 pass.