Attacks on Gen AI Data and Using Vector Encryption to Stop Them
This talk demonstrates how Retrieval-Augmented Generation (RAG) workflows create security risks by generating and storing shadow copies of sensitive data in vector databases. It highlights that these vector embeddings can be inverted back to their original input with high fidelity using inversion models, exposing private information. The speakers propose using distance-comparison-preserving encryption (DCPE) to protect vector data while maintaining search functionality. They also release an open-source library, IronCore Alloy, to implement this encryption technique.
Why Your RAG Implementation is Leaking Sensitive Data Through Vector Embeddings
TLDR: Retrieval-Augmented Generation (RAG) pipelines create massive, searchable shadow copies of your private data in vector databases. Researchers have demonstrated that these vector embeddings can be inverted back into high-fidelity text, effectively turning your vector store into a data breach waiting to happen. You can mitigate this risk by implementing distance-comparison-preserving encryption (DCPE) on your embeddings before they hit the database.
Security researchers have spent the last year obsessing over prompt injection, but the real structural vulnerability in modern AI stacks is hiding in plain sight: the vector database. When you build a RAG application, you are essentially taking your most sensitive internal documentation, chunking it, and running it through an embedding model to create a semantic search index. This process creates a secondary, often poorly secured, repository of your data that is optimized for similarity search rather than access control.
The Mechanics of Vector Inversion
Vector embeddings are not just random lists of numbers. They are high-dimensional representations of semantic meaning. Because these models are deterministic, the same input text will consistently produce the same vector. This property is exactly what makes them useful for search, but it is also what makes them vulnerable to model inversion attacks.
If an attacker gains access to your vector database, they do not need to know your original source documents to reconstruct them. By training a simple inversion model on the output of the same embedding model you use, they can map those vectors back to the original text. The research presented at DEF CON 2024 confirms that this is not just a theoretical risk. In many cases, an attacker can recover over 90% of the original input text with high fidelity.
This is not a complex exploit. The tools to perform these inversions are increasingly available as open-source projects. If you are a pentester, your next engagement should not just focus on the chat interface. You should be looking at the backend infrastructure. Can you access the vector store directly? If you can dump the embeddings, you can likely reconstruct the sensitive data they represent.
The Security Gap in Vector Databases
Most vector databases, including popular options like Weaviate, Qdrant, and Milvus, are currently in a state of extreme immaturity regarding security. Many ship with no authentication enabled by default. Even when authentication is present, they often lack granular Role-Based Access Control (RBAC).
When you store embeddings in these systems, you are creating a treasure map of your organization's most valuable information. If an attacker compromises the database, they do not need to perform a complex SQL injection to find the "admin" table. They can simply query the vector store for "confidential plans" or "executive salaries" and receive the most semantically similar chunks of your internal data. This is a direct violation of the principle of least privilege, as the database itself has no concept of who is authorized to see which document.
Protecting Your Embeddings with DCPE
The most effective way to stop this is to stop storing raw, searchable embeddings. Instead, you should use distance-comparison-preserving encryption (DCPE). This technique allows you to encrypt your vectors while maintaining the ability to perform similarity searches on the encrypted data.
The core idea is to apply a transformation to the vector that preserves the relative distances between points in the vector space. By scaling and perturbing the vector elements using a secret key, you ensure that the encrypted vectors remain searchable by the database, but are useless to an attacker who does not possess the key.
The team at IronCore Labs has released an open-source library called IronCore Alloy that implements this approach. It is written in Rust and provides bindings for Java, Kotlin, and Python. By integrating this into your ingestion pipeline, you can ensure that even if your vector database is fully compromised, the attacker is left with nothing but high-entropy noise.
Practical Steps for Your Next Engagement
If you are auditing a RAG-based application, start by mapping the data flow. Where are the embeddings generated? Where are they stored? If the application is using a third-party vector database, check if the data is encrypted at rest and in transit. More importantly, ask if the embeddings themselves are protected.
If you find that the embeddings are stored in plaintext, you have found a critical vulnerability. You can demonstrate the impact by performing a model inversion attack on a subset of the data. This is a much more compelling finding than a generic "lack of encryption" report. It shows the client exactly what an attacker can extract from their "secure" AI infrastructure.
Defenders should treat vector databases as high-value targets. If you are deploying RAG, you must treat your vector store with the same level of security as your primary production database. This means implementing strict network access controls, robust authentication, and, where possible, encryption of the embeddings themselves. Do not assume that because the data is "just a list of numbers" that it is safe. In the world of LLMs, those numbers are the keys to your kingdom.
Vulnerability Classes
Tools Used
Target Technologies
Attack Techniques
OWASP Categories
Up Next From This Conference

Breaking Secure Web Gateways for Fun and Profit

Listen to the Whispers: Web Timing Attacks That Actually Work

Abusing Windows Hello Without a Severed Hand
Similar Talks

Kill List: Hacking an Assassination Site on the Dark Web

Counter Deception: Defending Yourself in a World Full of Lies

