Spring Data Elasticsearch Flaw Allows Remote Code Execution via SpEL Injection

A high-severity vulnerability in Spring Data Elasticsearch allows attackers to execute arbitrary code by injecting SpEL expressions into query arguments. The flaw affects versions 6.1.0 through 6.1.2 and 6.0.0 through 6.0.8, with patches available in 6.1.3 and 6.0.9.
Key points
- The vulnerability, designated CVE-2026-123886, stems from the order of operations in Spring Data Elasticsearch, which replaces positional placeholders with method arguments before evaluating SpEL expressions.
- This sequence allows untrusted input to be interpreted as a SpEL expression, enabling remote attackers to execute arbitrary code even if the original query declaration does not use SpEL.
- The flaw carries a CVSS 3.1 score of 8.8 (High), with low attack complexity and no user interaction required, though it requires low-level privileges.
- Affected versions include Spring Data Elasticsearch 6.1.0 to 6.1.2 and 6.0.0 to 6.0.8; the issue is resolved in versions 6.1.3 and 6.0.9.
- Repeated exploitation can exhaust system memory due to an unbounded expression cache, posing a significant availability risk alongside data confidentiality and integrity breaches.
Background
Recent cybersecurity reports have highlighted a surge in SQL injection vulnerabilities across various document management and e-commerce systems, such as itsourcecode and Surya2Developer. While those flaws typically involve database manipulation, the current issue in Spring Data Elasticsearch represents a more severe risk due to its potential for remote code execution and memory exhaustion within a widely used Java framework.
Why it matters
This vulnerability poses a critical threat to enterprise applications relying on Spring Data Elasticsearch, as it allows attackers to bypass standard query safety mechanisms and execute malicious code. The high severity score and ease of exploitation underscore the need for immediate patching to prevent potential data breaches and service disruptions.
What to watch
Developers should immediately upgrade their Spring Data Elasticsearch dependencies to version 6.1.3 or 6.0.9 to mitigate the risk. Organizations should also audit their codebases for any repository query methods that pass untrusted input as arguments to @Query methods with positional placeholders.
Want the full story? Read the original reporting
Read on CVEs | Zero Wire | Cloudflare Radar