Elasticsearch Insertion of sensitive information in audit logs
Description
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Elasticsearch audit logs may leak sensitive credentials in cleartext when using deprecated _xpack/security API URIs, patched in 7.17.13 and 8.9.2.
Vulnerability
CVE-2023-31417 is an information disclosure vulnerability in Elasticsearch where the audit logging mechanism fails to filter sensitive information—such as passwords and tokens—when requests use certain deprecated _xpack/security API URIs. Normally, Elasticsearch redacts credentials before writing to the audit log, but this filtering is bypassed for the deprecated endpoints [1][3].
Exploitation
Exploitation requires that audit logging is explicitly enabled (disabled by default) and that a request body containing credentials is logged. The attacker must have administrative access to the audit logs or the log storage system. The deprecated APIs include operations like user creation, password change, and OAuth2 token management, which inherently handle sensitive data [3]. Official Elasticsearch clients do not use these deprecated endpoints, reducing the attack surface for typical deployments.
Impact
A successful exploit could expose cleartext credentials, including passwords and authentication tokens, in the audit logs. This could allow a local attacker with access to the logs to escalate privileges or move laterally within the environment. The CVSSv3.1 score is 4.1 (Medium), reflecting the high privileges required and the need for audit logging to be enabled [3].
Mitigation
Elastic has released patches in versions 7.17.13 and 8.9.2, which resolve the issue by ensuring that sensitive data is properly filtered even when using deprecated API URIs. Users are strongly advised to upgrade to the fixed versions. As a workaround, audit logging should be carefully configured to avoid logging request bodies that may contain secrets [3].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.elasticsearch:elasticsearchMaven | >= 7.0.0, < 7.17.13 | 7.17.13 |
org.elasticsearch:elasticsearchMaven | >= 8.0.0, < 8.9.2 | 8.9.2 |
Affected products
3- osv-coords2 versions
>= 7.0.0, < 7.17.13+ 1 more
- (no CPE)range: >= 7.0.0, < 7.17.13
- (no CPE)range: >= 7.0.0, < 7.17.13
- Range: 7.0.0
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
6- github.com/advisories/GHSA-99pc-69q9-jxf2ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-31417ghsaADVISORY
- discuss.elastic.co/t/elasticsearch-8-9-2-and-7-17-13-security-update/342479ghsaWEB
- security.netapp.com/advisory/ntap-20231130-0006ghsaWEB
- www.elastic.co/community/securityghsaWEB
- security.netapp.com/advisory/ntap-20231130-0006/mitre
News mentions
0No linked articles in our index yet.