CVE-2023-31417

CVE-2023-31417 is a medium-severity security vulnerability in org.elasticsearch:elasticsearch (maven), affecting versions >= 7.0.0, < 7.17.13. It is fixed in 7.17.13, 8.9.2.

Summary

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.

The _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.

The list of affected, deprecated APIs, is the following:

POST /_xpack/security/user/{username}
PUT /_xpack/security/user/{username}
PUT /_xpack/security/user/{username}/_password
POST /_xpack/security/user/{username}/_password
PUT /_xpack/security/user/_password
POST /_xpack/security/user/_password
POST /_xpack/security/oauth2/token
DELETE /_xpack/security/oauth2/token
POST /_xpack/security/saml/authenticate

Impact

CVE-2023-31417 has a CVSS score of 4.1 (Medium). The vector is requires local access, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (7.17.13, 8.9.2); upgrading removes the vulnerable code path.

Affected versions

org.elasticsearch:elasticsearch (>= 7.0.0, < 7.17.13) org.elasticsearch:elasticsearch (>= 8.0.0, < 8.9.2)

Security releases

org.elasticsearch:elasticsearch → 7.17.13 (maven) org.elasticsearch:elasticsearch → 8.9.2 (maven)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade the following packages to resolve this vulnerability:

org.elasticsearch:elasticsearch to 7.17.13 or later; org.elasticsearch:elasticsearch to 8.9.2 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2023-31417? CVE-2023-31417 is a medium-severity security vulnerability in org.elasticsearch:elasticsearch (maven), affecting versions >= 7.0.0, < 7.17.13. It is fixed in 7.17.13, 8.9.2.
  2. How severe is CVE-2023-31417? CVE-2023-31417 has a CVSS score of 4.1 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of org.elasticsearch:elasticsearch are affected by CVE-2023-31417? org.elasticsearch:elasticsearch (maven) versions >= 7.0.0, < 7.17.13 is affected.
  4. Is there a fix for CVE-2023-31417? Yes. CVE-2023-31417 is fixed in 7.17.13, 8.9.2. Upgrade to this version or later.
  5. Is CVE-2023-31417 exploitable, and should I be worried? Whether CVE-2023-31417 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2023-31417 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2023-31417?
    • Upgrade org.elasticsearch:elasticsearch to 7.17.13 or later
    • Upgrade org.elasticsearch:elasticsearch to 8.9.2 or later

Other vulnerabilities in org.elasticsearch:elasticsearch

CVE-2025-37727CVE-2024-52979CVE-2024-52981CVE-2024-52980CVE-2024-43709

Stop the waste.
Protect your environment with Kodem.