# GHSA-6g3j-p5g6-992f: OpenSearch StackOverflow vulnerability

> A specially crafted query in the OpenSearch _search API causes a Stack Overflow, leading to a Denial of Service.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Dec 2023

## What is GHSA-6g3j-p5g6-992f?

GHSA-6g3j-p5g6-992f is a denial of service vulnerability in org.opensearch:opensearch, published on 1 Dec 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
A flaw was discovered in OpenSearch, affecting the `_search` API that allowed a specially crafted query string to cause a Stack Overflow and ultimately a Denial of Service.

The issue was identified by Elastic Engineering and corresponds to security advisory [ESA-2023-14](https://discuss.elastic.co/t/elasticsearch-8-9-1-7-17-13-security-update/343297) (CVE-2023-31419).

### Mitigation
Versions 1.3.14 and 2.11.1 contain a fix for this issue.

### For more information
If you have any questions or comments about this advisory, please contact AWS/Amazon Security via our issue reporting page (https://aws.amazon.com/security/vulnerability-reporting/) or directly via email to [aws-security@amazon.com](mailto:aws-security@amazon.com). Please do not create a public GitHub issue.

## Which versions are affected by GHSA-6g3j-p5g6-992f?

4 open source packages ship an affected version, including org.opensearch:opensearch.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.opensearch:opensearch` | Maven | All versions | 1.3.14 |
| `org.opensearch:opensearch` | Maven | All versions | 1.3.14 |
| `org.opensearch:opensearch` | Maven | From 2.0.0 | 2.11.1 |
| `org.opensearch:opensearch` | Maven | From 2.0.0 | 2.11.1 |

## How do I fix GHSA-6g3j-p5g6-992f?

Upgrade org.opensearch:opensearch to a fixed version for your release line: 1.3.14 or 2.11.1.

## Is GHSA-6g3j-p5g6-992f being exploited?

There is no known exploitation of GHSA-6g3j-p5g6-992f in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-6g3j-p5g6-992f and fix it if it is affected.

What it is: GHSA-6g3j-p5g6-992f is a denial of service vulnerability in org.opensearch:opensearch, published on 1 Dec 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-6g3j-p5g6-992f in the wild and no public exploit code.

Affected packages and fixed versions:
- org.opensearch:opensearch (Maven): affected all versions; fixed in 1.3.14
- org.opensearch:opensearch (Maven): affected all versions; fixed in 1.3.14
- org.opensearch:opensearch (Maven): affected from 2.0.0; fixed in 2.11.1
- org.opensearch:opensearch (Maven): affected from 2.0.0; fixed in 2.11.1

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-6g3j-p5g6-992f/ (Markdown: https://insights.sbomify.com/GHSA-6g3j-p5g6-992f/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-6g3j-p5g6-992f

---
From sbomify Insights: https://insights.sbomify.com/GHSA-6g3j-p5g6-992f/
Summaries are generated and may contain mistakes; the official description above is the record.
