# CVE-2023-49922: Beats Insertion of Sensitive Information into Log File

> Attackers can read sensitive data from logs when Elastic Beats fails to ingest events, requiring an upgrade to fix.

- **Severity:** Medium 6.8 (`CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 12 Dec 2023
- **Updated:** 2 Dec 2024
- **Also known as:** GHSA-hj4r-2c9c-29h3, GO-2023-2413, MINI-4m68-7ccj-f3gr, MINI-6mx2-pwmp-p6rh, MINI-754g-3358-cvjv, MINI-8w3r-qvx5-c2jp, MINI-9chh-vqq7-9q3m, MINI-c3wc-537g-xr7v, MINI-c4q4-fqq3-jxhf, MINI-g2jg-cr7f-rjwm, MINI-p7cq-vgpq-f7gw, MINI-x4x6-4m87-f38j

## What is CVE-2023-49922?

CVE-2023-49922 is a medium-severity vulnerability in Elastic Beats, published on 12 Dec 2023. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

An issue was discovered by Elastic whereby Beats and Elastic Agent would log a raw event in its own logs at the WARN or ERROR level if ingesting that event to Elasticsearch failed with any 4xx HTTP status code except 409 or 429. Depending on the nature of the event that Beats or Elastic Agent attempted to ingest, this could lead to the insertion of sensitive or private information in the Beats or Elastic Agent logs. Elastic has released 8.11.3 and 7.17.16 that prevents this issue by limiting these types of logs to DEBUG level logging, which is disabled by default.

Weakness: CWE-532 (Insertion of Sensitive Information into Log File)

## Which versions are affected by CVE-2023-49922?

7 open source packages ship an affected version, including github.com/elastic/beats and github.com/elastic/beats/v7. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/elastic/beats` | Go | From 7.0.0 | 7.17.16 |
| `github.com/elastic/beats` | Go | From 7.0.0 | 7.17.16 |
| `github.com/elastic/beats` | Go | From 8.0.0 | 8.11.3 |
| `github.com/elastic/beats` | Go | From 8.0.0 | 8.11.3 |
| `github.com/elastic/beats/v7` | Go | All versions | 7.17.16 |
| `github.com/elastic/beats/v7` | Go | From 7.0.0 | 7.17.16 |
| `github.com/elastic/beats/v7` | Go | From 7.0.0 | 7.17.16 |

Products: Elastic Elastic Beats.

## How do I fix CVE-2023-49922?

Upgrade github.com/elastic/beats to a fixed version for your release line: 7.17.16 or 8.11.3.

## Is CVE-2023-49922 being exploited?

There is no known exploitation of CVE-2023-49922 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-49922 and fix it if it is affected.

What it is: CVE-2023-49922 is a medium-severity vulnerability in Elastic Beats, published on 12 Dec 2023. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-49922 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/elastic/beats (Go): affected from 7.0.0; fixed in 7.17.16
- github.com/elastic/beats (Go): affected from 7.0.0; fixed in 7.17.16
- github.com/elastic/beats (Go): affected from 8.0.0; fixed in 8.11.3
- github.com/elastic/beats (Go): affected from 8.0.0; fixed in 8.11.3
- github.com/elastic/beats/v7 (Go): affected all versions; fixed in 7.17.16
- github.com/elastic/beats/v7 (Go): affected from 7.0.0; fixed in 7.17.16
- github.com/elastic/beats/v7 (Go): affected from 7.0.0; fixed in 7.17.16

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/CVE-2023-49922/ (Markdown: https://insights.sbomify.com/CVE-2023-49922/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-49922
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-49922
- OSV: https://osv.dev/vulnerability/CVE-2023-49922

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-49922/
Summaries are generated and may contain mistakes; the official description above is the record.
