CVE-2026-123886
Spring Data Elasticsearch SpEL Expression Injection through String-based Query Method Arguments
Description
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.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.springframework.data » spring-data-elasticsearchpreliminary | >= 6.0.0, < 6.0.9>= 6.1.0, < 6.1.3 | 6.0.9, 6.1.3 |
Blast radius
37% of the dependent artifacts (18) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 54 |
| 2 hops | 59 |
| 3 hops | 250 |
| 4 hops | 66 |
| 5 hops | 2 |
Most used dependents
- org.springframework.boot » spring-boot-starter-data-elasticsearch193 usages
- org.springframework.boot » spring-boot-starter-test-classic20 usages
- io.github.vsvyatski » spring-content-autoconfigure13 usages
- org.opensearch.client » spring-data-opensearch-starter10 usages
- org.springframework.boot » spring-boot-data-elasticsearch8 usages
- org.springframework.boot » spring-boot-starter-classic4 usages
- org.opensearch.client » spring-data-opensearch3 usages
- io.softa » es-starter2 usages
- org.springframework.boot » spring-boot-autoconfigure-classic2 usages
- org.springframework.boot » spring-boot-data-elasticsearch-test2 usages
- org.springframework.boot » spring-boot-starter-data-elasticsearch-test2 usages
- com.nebula-projects » nebula-search-elasticsearch2 usages
- org.springframework.cloud.fn » spring-elasticsearch-consumer2 usages
- org.opensearch.client » spring-data-opensearch-test-autoconfigure1 usages
- org.opensearch.client » spring-data-opensearch-testcontainers1 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
