CVE-2023-31417: Elasticsearch Elasticsearch Allows Insertion Of Sensitive Vulnerability
MODERATECVE-2023-31417 is a MODERATE (CVSS 4.1) elasticsearch allows insertion of sensitive vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Elasticsearch libraries in the Maven ecosystem. The issue involves elasticsearch allows insertion of sensitive information into log files when using deprecated uris. Remediation is available by upgrading affected packages to version 7.17.13, 8.9.2.
CVE-2023-31417 at a Glance
Security Impact
CVSS: 4.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2023-31417
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.
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>7.17.13</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>8.9.2</version>
</dependency>
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-31417, 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.13), 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
CVE-2023-31417 Affected Elasticsearch Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.elasticsearch:elasticsearch
|
Maven |
≥ 7.0.0
< 7.17.13
|
7.17.13
|
|
org.elasticsearch:elasticsearch
|
Maven |
≥ 8.0.0
< 8.9.2
|
8.9.2
|
References
Frequently Asked Questions
What is CVE-2023-31417?
Which Elasticsearch versions are affected?
What version fixes CVE-2023-31417?
Is elasticsearch affected?
What is the CVSS score of CVE-2023-31417?
What CWE is associated with CVE-2023-31417?
How can I check Maven dependencies for CVE-2023-31417?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-99pc-69q9-jxf2",
"modified" : "2025-02-13T19:19:40Z",
"published" : "2023-10-26T18:30:23Z",
"aliases" : [ "CVE-2023-31417" ],
"summary" : "Elasticsearch allows insertion of sensitive information into log files when using deprecated URIs",
"details" : "Elasticsearch generally filters out sensitive information and credentials before logging to the audit log. It was found that this filtering was not applied when requests to Elasticsearch use certain deprecated URIs for APIs. The impact of this flaw is that sensitive information such as passwords and tokens might be printed in cleartext in Elasticsearch audit logs. Note that audit logging is disabled by default and needs to be explicitly enabled and even when audit logging is enabled, request bodies that could contain sensitive information are not printed to the audit log unless explicitly configured.\n\nThe `_xpack/security` APIs have been deprecated in Elasticsearch 7.x and were entirely removed in 8.0.0 and later. The only way for a client to use them in Elasticsearch 8.0.0 and later is to provide the `Accept: application/json; compatible-with=7` header. Elasticsearch official clients do not use these deprecated APIs.\n\nThe list of affected, deprecated APIs, is the following:\n\n`POST /_xpack/security/user/{username}`\n`PUT /_xpack/security/user/{username}`\n`PUT /_xpack/security/user/{username}/_password`\n`POST /_xpack/security/user/{username}/_password`\n`PUT /_xpack/security/user/_password`\n`POST /_xpack/security/user/_password`\n`POST /_xpack/security/oauth2/token`\n`DELETE /_xpack/security/oauth2/token`\n`POST /_xpack/security/saml/authenticate`",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.elasticsearch:elasticsearch"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.17.13"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.elasticsearch:elasticsearch"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.9.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-31417"
}, {
"type" : "WEB",
"url" : "https://discuss.elastic.co/t/elasticsearch-8-9-2-and-7-17-13-security-update/342479"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20231130-0006"
}, {
"type" : "WEB",
"url" : "https://www.elastic.co/community/security"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-532" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-10-30T15:14:03Z",
"nvd_published_at" : "2023-10-26T18:15:08Z"
}
}