How a Side-Channel Attack Exposed Hidden Data in OpenSearch

K

Kevin Hwang

Guest

Summary​


Tl;dr: In our research, we found an unauthorized data access vulnerability in OpenSearch that allowed an attacker to extract vector fields protected by field-level security using OpenSearch's vector search as a side-channel.

We reported the issue to OpenSearch team along with a proposed patch, and the vulnerability has since been fixed as of 3.10.

Background​


9qWtVsuknggFnDEJs0WSdn1bKtx2-2026-11-26T05:27:50.538Z-ysoui8bsv6sds7i45vb8nujv


OpenSearch is an open source distributed search engine created by Amazon, a popular alternative proprietary Elasticsearch.

Besides the more traditional lexical search and analytics capabilities, it also functions as a vector database, which has become increasingly important for AI and ML applications — RAG, semantic search, recommender systems, etc.

Vector Databases​


One of the most common use cases of vector databases is to store and search for vector embeddings.

An embedding is a point or vector that represents some concept — e.g., a word, image, or something more abstract and opaque — in some high dimensional embedding space.

Often in these embedding spaces, spatial relationships encode semantic relationships. E.g., in the very oversimplified example below:

  • "King" is close to "prince," but far from, say, "computer"
  • Going from "king" to "queen" is similar to going from "man" to "woman"

9qWtVsuknggFnDEJs0WSdn1bKtx2-2026-11-26T05:27:50.543Z-t2qwjeevv2bzjsvk5dq755h3


Tl;dr, vector databases are important, and OpenSearch is one such popular database technology.

Field-Level Security​


OpenSearch has a security feature called field-level security (FLS) which allows you to control which document fields a role can read in an index.

For example, a cluster might have users with different roles, e.g., QA, support, MLEs, SREs accessing the cluster for different purposes, along with service principals representing different programatic workloads — documents might be composed of different data that not all should have access to even when they have access to an underlying document itself.

FLS essentially allows you to create different projections of an index with different fields visible or hidden to different users, without having to duplicate that data into a separate index per view.

A wild side-channel appears!​


In using FLS, we noticed something intriguing: while FLS hid the literal values of fields from users for whom that field was configured as excluded, and while those fields were completely disregarded by lexical search, if the field was a vector field, it was still eligible for vector search, and still influenced search candidacy, scoring, and ranking.

If you're familiar with the idea of side-channels in security, alarm bells should be going off in your head right now. 🚨

The Art Of The Side-Channel​


Any time you have an inaccessible secret, but you are able to indirectly learn information correlated with it, you have a potential side-channel vulnerability.

Two illustrative examples are that of acoustic cryptanalysis and power analysis.

  • In 2004, researchers demonstrated microphone recordings of a computer performing cryptographic RSA operations could be used to recover the private key. As the CPU worked, power consumption varied, along with timing of different steps in the workflow, which caused variations in the noise emitted by different electrical components, apparently enough to work out the data the CPU was operating on.
  • In 2023, researchers demonstrated an attack where a video recording taken by a smartphone camera of another device's status LED while it was performing cryptographic operations could be used to recover private keys. In their own words:
The intensity/color of the power LEDs can be used to detect the beginning and end of cryptographic operations. This can be done because the intensity/brightness of a device's power LED […] correlates with its power consumption (which is affected by the CPU operations). This is caused by the fact that the power LED is connected directly to the power line of the electrical circuit which lacks effective means (e.g., filters, voltage stabilizers) of decoupling the correlation with the power consumption.

9qWtVsuknggFnDEJs0WSdn1bKtx2-2026-11-26T05:27:50.543Z-hmjee0uua7v99ho3rmt3b02i


The OpenSearch FLS k-NN Attack​


Here's how the attack works:

At a high level, if a document with a hidden vector field x can be included and scored in a vector search, the score returned for a particular query vector q will be some measure of the similarity between x and q. With clever probing of q, we can reconstruct x.

For example, for an L2 vector space, OpenSearch documents the distance function between two vectors as the squared Euclidean distance.

For a given hidden vector x and query vector q (the probe), this gives us:

9qWtVsuknggFnDEJs0WSdn1bKtx2-hp839gg.jpeg


The squared distance is thus recoverable from the score:

9qWtVsuknggFnDEJs0WSdn1bKtx2-hi939ok.jpeg


Then, for a unit basis vector :

9qWtVsuknggFnDEJs0WSdn1bKtx2-7qa39du.jpeg


From which the components of x can be computed:

9qWtVsuknggFnDEJs0WSdn1bKtx2-idb39zt.jpeg


For an n-dimensional vector, this requires n+1 probes to recover the original .

This still requires that the target document enter the k-NN candidate set — in order to return a score — for each probe query. In theory this may be difficult if the index is large and there are many vectors, but in practice this can often be achieved, and an attacker can increase their chances by upping the k of the query.

9qWtVsuknggFnDEJs0WSdn1bKtx2-2026-11-26T05:27:50.548Z-d7npptodxjjw34eeostt87on


Example​


Let's walk through an example.

There's a document in index_1 you have access to with:

  • A 2-D vector field hidden_vec whose value (say, [3.25, 4.75]) is hidden to you due to FLS exclusions
  • Visible fields like "visible_tag": "target"

You send 3 search queries:

Code:
GET /index_1/_search
{
  "size": 1,
  "query": {
    "bool": {
      "must": [{ "knn": { "hidden_vec": { "vector": [0, 0], "k": 128 } } }],
      "filter": [{ "term": { "visible_tag": "target" } }]
    }
  }
}

Repeat twice more with [0, 1] and [1, 0]. OpenSearch returns the following _scores, from which the squared distances d(q) can be computed from the derivations above:


Probe q

_score

d(q)

[0, 0]

0.02930403

33.125

[1, 0]

0.03493450

27.625

[0, 1]

0.03902439

24.625

Substituting these into the equations above yields [3.25000049, 4.74999951], approximately (due to the scores being rounded) the original vector in this case!

Voilà, you've just stolen a vector via side-channel! 🎉

Root Cause​


The technical root cause was a flaw in the k-NN plugin's implementation of vector search: unlike lexical search which completely disregards FLS-excluded fields for purposes of matching and ranking via filtered view, the k-NN plugin during vector search unwrapped the filtered view, accessing the raw reader underneath and thus considered as candidates vectors that should've been hidden by FLS, and returned their scores.

Coordinated Disclosure Timeline​

  • 2026/09/25: Vulnerability discovered, reported
  • 2026/09/30: OpenSearch SRT accepted report
  • 2026/10/05: Fix scheduled for OpenSearch 3.10.0
  • 2026/11/17: OpenSearch 3.10.0 released
 

Thread statistics

Created
Kevin Hwang,
Replies
0
Views
16
Back
Top