CVE-2023-49921: Elasticsearch Elasticsearch Insertion Of Sensitive Information Vulnerability

MODERATE
Advisory Identifier: GHSA-2hjr-vmf3-xwvp
CVSS 5.2
CWE-532
Published
Advisory Summary

CVE-2023-49921 is a MODERATE (CVSS 5.2) elasticsearch insertion of sensitive information vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Elasticsearch libraries in the Maven ecosystem. The issue involves elasticsearch insertion of sensitive information into log file. Remediation is available by upgrading affected packages to version 7.17.16, 8.11.2.

CVE-2023-49921 at a Glance

CVE Identifier CVE-2023-49921
GHSA Identifier GHSA-2hjr-vmf3-xwvp
Severity MODERATE
CVSS v3.1 Base Score 5.2
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Elasticsearch
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N).

Attack Vector Adjacent (AV:A)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2023-49921

To remediate this vulnerability, upgrade all affected Elasticsearch dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.elasticsearch:elasticsearch fixed: 7.17.16
<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>7.17.16</version>
</dependency>
org.elasticsearch:elasticsearch fixed: 8.11.2
<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>8.11.2</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.elasticsearch

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-49921, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.elasticsearch

Analyze the terminal output to locate any version of Elasticsearch in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.17.16), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.elasticsearch command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. In Elasticsearch, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

An issue was discovered by Elastic whereby Watcher search input logged the search query results on DEBUG log level. This could lead to raw contents of documents stored in Elasticsearch to be printed in logs. Elastic has released 8.11.2 and 7.17.16 that resolves this issue by removing this excessive logging. This issue only affects users that use Watcher and have a Watch defined that uses the search input and additionally have set the search input’s logger to DEBUG or finer, for example using: org.elasticsearch.xpack.watcher.input.search, org.elasticsearch.xpack.watcher.input, org.elasticsearch.xpack.watcher, or wider, since the loggers are hierarchical.

CVE-2023-49921 Affected Elasticsearch Versions

2 component(s)
Fixed Versions:
7.17.168.11.2
Product / Package Ecosystem Affected Versions Fixed Version
org.elasticsearch:elasticsearch
Maven
< 7.17.16
7.17.16
org.elasticsearch:elasticsearch
Maven
≥ 8.0.0
< 8.11.2
8.11.2

References

Frequently Asked Questions

What is CVE-2023-49921?
CVE-2023-49921 is a security vulnerability in Elasticsearch involving Elasticsearch Insertion of Sensitive Information into Log File under CWE-532: Insertion of Sensitive Information into Log File.
Which Elasticsearch versions are affected?
Affected versions include releases prior to 7.17.16, 8.11.2 across affected packages: org.elasticsearch:elasticsearch.
What version fixes CVE-2023-49921?
Upgrading to 7.17.16, 8.11.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is elasticsearch affected?
Yes, org.elasticsearch:elasticsearch is affected in releases prior to 7.17.16, 8.11.2. Upgrade your dependency to 7.17.16, 8.11.2 or later.
What is the CVSS score of CVE-2023-49921?
CVE-2023-49921 has a CVSS v3.1 base score of 5.2 (MODERATE) with vector string CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2023-49921?
CVE-2023-49921 is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check Maven dependencies for CVE-2023-49921?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.elasticsearch'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2hjr-vmf3-xwvp",
  "modified" : "2024-07-26T14:18:08Z",
  "published" : "2024-07-26T06:30:47Z",
  "aliases" : [ "CVE-2023-49921" ],
  "summary" : "Elasticsearch Insertion of Sensitive Information into Log File",
  "details" : "An issue was discovered by Elastic whereby Watcher search input logged the search query results on DEBUG log level. This could lead to raw contents of documents stored in Elasticsearch to be printed in logs. Elastic has released 8.11.2 and 7.17.16 that resolves this issue by removing this excessive logging. This issue only affects users that use Watcher and have a Watch defined that uses the search input and additionally have set the search input’s logger to DEBUG or finer, for example using: org.elasticsearch.xpack.watcher.input.search, org.elasticsearch.xpack.watcher.input, org.elasticsearch.xpack.watcher, or wider, since the loggers are hierarchical.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:A/AC:L/AT:P/PR:L/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.elasticsearch:elasticsearch"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.17.16"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.elasticsearch:elasticsearch"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.11.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-49921"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.elastic.co/t/elasticsearch-8-11-2-7-17-16-security-update-esa-2023-29/349179"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/elastic/elasticsearch"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-532" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-26T14:18:08Z",
    "nvd_published_at" : "2024-07-26T05:15:10Z"
  }
}