Spring Data Elasticsearch SpEL Expression Injection through String-based Query Method Arguments

HIGH | NOVEMBER 19, 2026 | CVE-2026-123886

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 Spring Products and Versions

Spring Data Elasticsearch:

  • 6.1.0 - 6.1.2
  • 6.0.0 - 6.0.8

Mitigation

Users of affected versions should upgrade to the corresponding fixed version.
Fix versionAvailability
6.1.3OSS
6.0.9OSS

If an upgrade is not possible, reject input containing #{ before passing it to @Query methods, or build such queries through CriteriaQuery or NativeQuery instead of string-based queries.

Credit

This issue was identified and responsibly reported by waydeshi and Daehyun Kang (@daehyuh) [email protected].

History

  • 2026-11-19: Initial vulnerability report published.

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

TrueSource Spring Enterprise offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all