# GHSA-2rjv-cv85-xhgm: OpenSearch unauthorized data access on fields protected by field level security if field is a member of an object

> Attackers with low privileges can bypass Field Level Security to read protected nested data in OpenSearch if specific exclusion rules are used.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Aug 2025

## What is GHSA-2rjv-cv85-xhgm?

GHSA-2rjv-cv85-xhgm is a missing authorization vulnerability in org.opensearch.plugin:opensearch-security, published on 1 Aug 2025. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Impact

OpenSearch versions 2.19.2 and earlier improperly apply Field Level Security (FLS) rules on fields which are not at the top level of the source document tree (i.e., which are members of a JSON object). 

If an FLS exclusion rule (like `~object`) is applied to an object valued attribute in a source document, the object is properly removed from the `_source` document in search and get results. However, any member attribute of that object remains available to search queries. This allows to reconstruct the original field contents using range queries. 

### Patches

The issue has been resolved in OpenSearch 3.0.0 and OpenSearch 2.19.3.

### Workarounds

If FLS exclusion rules are used for object valued attributes  (like `~object`), add an additional exclusion rule for the members of the object  (like `~object.*`).

## Which versions are affected by GHSA-2rjv-cv85-xhgm?

2 open source packages ship an affected version, including org.opensearch.plugin:opensearch-security.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.opensearch.plugin:opensearch-security` | Maven | All versions | 2.19.3.0 |
| `org.opensearch.plugin:opensearch-security` | Maven | All versions | 2.19.3.0 |

## How do I fix GHSA-2rjv-cv85-xhgm?

Upgrade org.opensearch.plugin:opensearch-security to 2.19.3.0 or later.

## Is GHSA-2rjv-cv85-xhgm being exploited?

There is no known exploitation of GHSA-2rjv-cv85-xhgm in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-2rjv-cv85-xhgm and fix it if it is affected.

What it is: GHSA-2rjv-cv85-xhgm is a missing authorization vulnerability in org.opensearch.plugin:opensearch-security, published on 1 Aug 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-2rjv-cv85-xhgm in the wild and no public exploit code.

Affected packages and fixed versions:
- org.opensearch.plugin:opensearch-security (Maven): affected all versions; fixed in 2.19.3.0
- org.opensearch.plugin:opensearch-security (Maven): affected all versions; fixed in 2.19.3.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-2rjv-cv85-xhgm/ (Markdown: https://insights.sbomify.com/GHSA-2rjv-cv85-xhgm/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-2rjv-cv85-xhgm

---
From sbomify Insights: https://insights.sbomify.com/GHSA-2rjv-cv85-xhgm/
Summaries are generated and may contain mistakes; the official description above is the record.
