CVE-2026-123886 in Spring Data Elasticsearchinfo

Summary

by MITRE • 11/23/2026

Spring Data Elasticsearch replaces positional placeholders in string-based @Query methods with the method arguments before it evaluates SpEL expressions in the resulting query string.



As a result, an argument that contains a SpEL expression is evaluated as part of the query, even if the declared query does not use SpEL.



An application is affected if it passes untrusted input as an argument to a repository query method that declares a @Query with positional placeholders.



In that case, a remote attacker can execute arbitrary code in the application, and repeated requests can exhaust memory through the unbounded expression cache.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 11/23/2026

The vulnerability described involves a critical flaw in how Spring Data Elasticsearch processes string-based queries annotated with @Query methods. Specifically, positional placeholders within these query strings are replaced by method arguments prior to the evaluation of any embedded Spring Expression Language (SpEL) expressions. This ordering creates a significant security gap because it allows untrusted input passed as an argument to be interpreted and executed as SpEL code, even if the original query definition did not intend for or declare the use of SpEL features. Consequently, this behavior effectively bypasses intended safeguards against expression injection attacks within the context of Elasticsearch repository operations.

From a technical perspective, the core issue lies in the sequence of operations during query execution. When an application invokes a repository method with positional parameters, Spring Data first substitutes these placeholders with the provided values. Only after this substitution does it check for and evaluate SpEL expressions present in the resulting string. If an attacker supplies input containing valid SpEL syntax, such as accessing system properties or executing classes via T() operators, that code is evaluated by the application server's expression evaluator. This mechanism transforms what should be a simple data parameter into executable script logic, leading to Remote Code Execution (RCE). The flaw is particularly dangerous because it affects applications using standard repository patterns without requiring complex configuration changes, making widespread exploitation possible across many Spring Boot and Spring Data projects.

The operational impact of this vulnerability is severe, primarily characterized by the potential for arbitrary code execution on the host system running the vulnerable application. An attacker can leverage this to read sensitive files, modify database contents, or use the compromised server as a pivot point for further network attacks. Additionally, the vulnerability introduces a risk of Denial of Service (DoS) through resource exhaustion. The underlying SpEL implementation maintains an unbounded cache for compiled expressions. By sending repeated requests with varying malicious payloads that trigger new expression compilations, an attacker can fill this cache indefinitely, leading to excessive memory consumption and eventual application crash or system instability. This dual impact combines confidentiality and integrity breaches via RCE with availability risks through resource exhaustion.

In terms of industry classification standards, this vulnerability aligns closely with CWE-94 Improper Control of Generation of Code (Code Injection), specifically where user input is directly incorporated into executable code without adequate sanitization or context-aware parsing. Furthermore, the exploitation technique maps to MITRE ATT&CK techniques related to Command and Scripting Interpreter abuse, particularly T1059 which covers execution via scripting interpreters like SpEL in Java environments. The unbounded cache aspect also relates to CWE-400 Uncontrolled Resource Consumption, highlighting the secondary impact vector available to attackers seeking to disrupt service availability rather than gain code execution privileges.

Mitigation strategies must focus on preventing the evaluation of user-supplied data as expressions and ensuring that expression caches are properly bounded or disabled when not strictly necessary for performance optimization. The primary defense is to upgrade Spring Data Elasticsearch to a version where this processing order has been corrected, typically by evaluating SpEL before substituting positional parameters or by completely disabling SpEL in query contexts unless explicitly required and secured. Applications should also implement strict input validation on all arguments passed to repository methods, treating any external input as untrusted until proven safe. Additionally, configuring the underlying expression evaluator to disable dangerous features such as class loading via T() operators can reduce the blast radius of successful exploitation attempts. Monitoring for unusual memory usage patterns associated with high volumes of distinct query executions can also serve as an early warning indicator for active probing or attacks targeting this specific flaw.

Responsible

Vmware

Reservation

11/06/2026

Disclosure

11/23/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!