Spring Data Elasticsearch SpEL injection RCE
High · prioritize
Risk assessment
Spring Data Elasticsearch evaluates SpEL in query arguments, letting attackers run arbitrary code (CVSS 8.8). Upgrade to patched releases now.
What to do
Apply the latest security patches from the vendor. If patching is not immediately possible, review the mitigation steps in this advisory and monitor for exploitation attempts.
- No fixed version listed yet. Restrict exposure and watch the vendor advisory. NVD references
- Remediation in this advisory
Exploitation confirmed - public proof-of-concept - CVE-2026-123886 is a high-severity remote code execution flaw in Spring Data Elasticsearch string-based @Query repository methods that lets a remote attacker execute arbitrary code in the application. Patched Spring Data Elasticsearch releases are available; upgrade immediately.
Overview
Spring Data Elasticsearch replaces positional placeholders in string-based @Query methods with the supplied method arguments before it evaluates SpEL (Spring Expression Language) expressions in the resulting query string. Because substitution happens before SpEL evaluation, an argument that itself contains a SpEL expression is evaluated as part of the query, even when the declared query does not use SpEL at all.
Any application that passes untrusted input as an argument to a repository query method declaring a @Query with positional placeholders is affected. The attacker does not need a misconfiguration or a special feature flag: the injection path is the repository query layer that developers use every day.
Impact
A remote attacker who controls a query argument can trigger SpEL evaluation and execute arbitrary code in the application’s JVM context, with the privileges of the application process. That typically means access to data sources, secrets, and internal services reachable from the application. The CVSS score is 8.8 (HIGH), with a network attack vector, low complexity, low privileges required, and no user interaction. The vulnerability also allows repeated requests to exhaust memory through the unbounded expression cache, giving an attacker a denial-of-service path against the same endpoint. This vulnerability is not currently known to be exploited in the wild, but the public proof of concept lowers the barrier to abuse.
Remediation
Upgrade Spring Data Elasticsearch to a release that includes the fix, then redeploy. Audit every repository method that declares a @Query with positional placeholders and receives user-supplied arguments. Where an upgrade cannot be applied immediately, validate and constrain argument values at the controller or service layer so that SpEL syntax such as ${ and #{ cannot reach the repository call, and treat those arguments as untrusted input throughout.
Review application logs for SpEL fragments in query parameters and for sudden memory pressure on Elasticsearch-backed services. Teams that need to confirm exposure can inspect repository interfaces for @Query placeholders and follow the vendor advisory for exact patched versions.
Security Insight
This flaw is another example of a substitution-before-evaluation ordering bug, where a framework’s convenience layer silently upgrades untrusted data into executable expression language. It echoes prior SpEL injection findings in Spring components, suggesting that the same class of mistake recurs wherever template expansion and expression evaluation share a code path. For defenders, it reinforces that repository abstractions are security-sensitive code, not just plumbing, and deserve the same review as authentication and deserialization layers. Data breach reports are available at breach reports, and current cybersecurity news at security news.
Further Reading
Exploit references 1 PoC Show
Public PoC References
Unverified third-party code
These repositories are publicly listed on GitHub and have not been audited by Yazoul Security. They may contain malware, backdoors, destructive payloads, or operational security risks (telemetry, exfiltration). Treat them as hostile binaries. Inspect source before execution. Run only in isolated, disposable lab environments (offline VM, no credentials, no production data).
Authorized use only. This information is provided for defensive research, detection engineering, and patch validation. Using exploit code against systems you do not own or do not have explicit written permission to test is illegal in most jurisdictions and violates Yazoul's terms of use.
| Repository | Stars |
|---|---|
| googlesky/CVE-2026-123886 Spring Data Elasticsearch: @Query placeholders replaced with args before SpEL evaluation — untrusted argument executes arbitrary code. Verbatim createQuery ordering from 2a5b65c^ vs fix: injected expr | ★ 0 |
Showing 1 of 1 known references. Source: nomi-sec/PoC-in-GitHub.