The Spring team shipped the Spring Data 2026.0.3 and 2025.1.9 service releases on November 19, 2026. Apart from routine bug fixes and dependency bumps, the two release trains close four security vulnerabilities in the MongoDB, REST, Elasticsearch and Neo4j modules.
The most serious one lets an attacker run code inside an application that uses Spring Data Elasticsearch with string-based queries. Since Spring Data sits between a huge number of Java services and their databases, teams on Spring Boot should check which modules they pull in and upgrade soon.
The four vulnerabilities
Each flaw needs a specific coding pattern to be exploitable, so not every application is exposed. Here is what Spring describes:
- CVE-2026-123886, Spring Data Elasticsearch: positional placeholders in a string-based @Query were filled in with method arguments before SpEL expressions were evaluated. An argument holding a SpEL expression was therefore evaluated too, even when the declared query used no SpEL at all. That opens the door to remote code execution, and repeated requests can also fill memory through an unbounded expression cache.
- CVE-2026-59342, Spring Data MongoDB: bound String values were not escaped for their context when a placeholder sat inside a quoted literal of a server-side script expression such as $where, $function or $accumulator. This can lead to query logic injection.
- CVE-2026-59377, Spring Data REST: a repository made read-only by hiding its save method still accepted POST requests on collection-style association resources. Such a request could add new links to an aggregate that was meant to stay unchanged.
- CVE-2026-125080, Spring Data Neo4j: listed in the release post as a Cypher injection issue in custom queries. Its separate advisory page was not available when this story was written.
When an application is affected
For the Elasticsearch flaw, the risk exists when untrusted input is passed as an argument to a repository method whose @Query uses positional placeholders. The CVSS vector in the advisory rates the impact on confidentiality, integrity and availability as high, with low privileges required.
The MongoDB issue needs three things at once. Server-side JavaScript must be enabled on the MongoDB server, untrusted String input must reach a repository method without cleaning, and the method's query or aggregation template must place that value inside a script operator.
The REST issue applies when save is not exported, the domain type has a writable collection association, and the target type is also exported through its own repository. Whether an attacker needs to log in first depends on how the application secures its endpoints.
Affected and fixed versions
The open source fixes arrive in the module versions that make up the two release trains:
- Spring Data Elasticsearch: 6.1.0 to 6.1.2 and 6.0.0 to 6.0.8 are affected. Fixed in 6.1.3 and 6.0.9.
- Spring Data MongoDB: 5.1.0 to 5.1.2, 5.0.0 to 5.0.8 and several older lines are affected. Fixed in 5.1.3 and 5.0.9.
- Spring Data REST: 5.1.0 to 5.1.2, 5.0.0 to 5.0.8 and older lines are affected. Fixed in 5.1.3 and 5.0.9.
- Spring Data Neo4j: the 2026.0.3 train ships Neo4j module 8.1.3 with the fix.
Fixes for the older MongoDB and REST lines, such as 4.5.x, 4.4.x and the 3.x branches, are offered only to Enterprise Support customers. The release post also warns that the 2025.1 generation is close to the end of its open source support.
What it means for developers
The common thread is that query text built from templates can turn user input into code or query logic. If your repositories rely on @Query strings with placeholders, review them first, starting with Elasticsearch and any MongoDB templates that use script operators.
The same lesson applies to any database work, whether it is Spring Data in Java or dynamic SQL in PL/SQL. Values should always travel as bind variables, never as text pasted into the statement, a point covered in our guide on how to prevent SQL injection with DBMS_ASSERT in PL/SQL.
Spring also lists workarounds for teams that cannot upgrade right away:
- For Elasticsearch, reject arguments that contain the characters #{ before they reach a @Query method, or switch to CriteriaQuery or NativeQuery.
- For MongoDB, wrap placeholders that should receive a String in quotes so that escaping is applied, and consider turning off server-side JavaScript if you do not use it.
- For REST, block POST on association resources for untrusted users at the security layer, or hide the association from export.
How to upgrade
Most projects get Spring Data through the Spring Boot dependency management or the Spring Data BOM. Moving the BOM to 2026.0.3, or to 2025.1.9 for the older line, pulls in the patched modules together.
After the change, run your dependency report to confirm the module versions, then run the repository tests. Because the MongoDB fix changes how placeholders are escaped, queries that build script expressions deserve a careful look in testing.
Conclusion
These are service releases, but the security content makes them more than routine. The Elasticsearch code execution flaw is the top priority, followed by the MongoDB and Neo4j injection issues and the REST access gap.
Teams still on the 2025.1 line should plan their move to 2026.0 or newer, since open source support for it is ending soon.
Sources
- Spring Blog: Spring Data 2026.0.3 and 2025.1.9 released
- Spring Security Advisory: CVE-2026-123886
- Spring Security Advisory: CVE-2026-59342
- Spring Security Advisory: CVE-2026-59377
See my articles more often when you search Google.
