AI Security · Learn

What are vector and embedding weaknesses?

RAG systems turn your documents into embeddings stored in a vector database. If that store is weakly controlled, attackers can recover the original text, read another tenant's data, or poison what the model retrieves.

TL;DR

Vector and embedding weaknesses (OWASP LLM08:2025) are flaws in how retrieval-augmented generation (RAG) systems create, store, and query embeddings. Embeddings can be inverted to recover sensitive source text, vector stores that mix tenants can leak data across customers, and unvalidated documents can poison retrieval so the model is fed attacker-controlled context. Defend with per-tenant isolation, access control on the vector store, source validation, and treating retrieved content as untrusted.

By Rohit Hatagale, AI Security Lead, SecureLayer7Updated

What these weaknesses are

RAG improves answers by retrieving relevant documents and feeding them to the model. To do that, text is converted into embeddings (numeric vectors) stored in a vector database and searched by similarity. Weaknesses arise across that pipeline: embeddings are not a safe one-way hash and can leak their source, vector stores often lack the access controls of a normal database, and the retrieval step trusts whatever it pulls back.

How the attacks work

Three main paths. Embedding inversion: given access to embeddings, an attacker reconstructs approximate original text, so storing embeddings of sensitive data can leak that data. Cross-tenant leakage: a multi-tenant vector store without strict isolation returns one customer's documents in another's queries, or an attacker crafts queries that surface data they should not see. Retrieval poisoning: an attacker plants documents through any ingestion path so their content is retrieved and injected into the prompt, an indirect prompt injection through the knowledge base. Shown for defensive testing.

How to defend against them

Isolate tenants at the vector-store level with separate namespaces or stores and per-tenant filters enforced server-side, not in the prompt. Put access control and authentication on the vector database as you would any datastore, and encrypt embeddings of sensitive data. Validate and attribute documents before ingestion, and treat retrieved content as untrusted input to the model. Test what a single query can surface across tenants and permission levels.

References

  1. [1]OWASP Top 10 for LLM Applications (2025)(OWASP)
  2. [2]Morris et al., Text Embeddings Reveal (Almost) As Much As Text(arXiv)
Related terms

A weakly controlled vector store leaks the data RAG was meant to use safely. Talk to a security expert about testing your RAG pipeline.

Related service
AI Penetration Testing
Adversarial testing of your LLM and AI features, prompt injection, data exfiltration, and agent abuse, with reproducible findings.
AI penetration testing

FAQ

Vector and embedding weaknesses, asked often

Scope an engagement

Test your AI application before an attacker does.

Our AI red team probes your LLM and agent features the way an attacker would, prompt injection, tool abuse, and data exfiltration, and ships findings with reproducible attacks and fixes your team can implement.