CVE-2026-59342
Spring Data MongoDB String query logic injection via function operator bind parameter
Description
Spring Data MongoDB's parameter binding mechanism for JSON-based query and aggregation using placeholder syntax did not contextually escape bound String argument values when those placeholders appeared inside a quoted string literal.
The application is vulnerable if all of the following are true:
MongoDB server-side JavaScript functions are enabled. The application accepts input parameters from untrusted sources and uses them without prior sanitization as repository query method argument of type String. The repository method is annotated with an MQL query template (e.g. @Query, @Aggregation) that uses a value placeholder inside a script expression (e.g. $accumulator, $function, $where, ...)
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.springframework.data » spring-data-mongodb | <= 3.4.21>= 4.4.0, <= 4.4.16>= 4.5.0, <= 4.5.14>= 5.0.0, < 5.0.9>= 5.1.0, < 5.1.3 | 5.0.9, 5.1.3 |
Blast radius
63% of the dependent artifacts (1,227) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 24,957 |
| 2 hops | 11,565 |
| 3 hops | 5,422 |
| 4 hops | 1,753 |
| 5 hops | 228 |
| 6 hops | 20 |
Most used dependents
- org.springframework.boot » spring-boot-starter-data-mongodb839 usages
- org.apereo.cas » cas-server-core-util-api492 usages
- org.apereo.cas » cas-server-core-configuration-api442 usages
- org.apereo.cas » cas-server-core-authentication-api400 usages
- org.apereo.cas » cas-server-core-api-test-category335 usages
- org.apereo.cas » cas-server-core-util296 usages
- org.apereo.cas » cas-server-core-web-api288 usages
- org.apereo.cas » cas-server-core-services280 usages
- org.apereo.cas » cas-server-core-configuration264 usages
- org.apereo.cas » cas-server-core-services-api243 usages
- org.apereo.cas » cas-server-core-authentication232 usages
- org.apereo.cas » cas-server-core-web212 usages
- org.apereo.cas » cas-server-core-tickets182 usages
- org.apereo.cas » cas-server-core-services-authentication155 usages
- org.apereo.cas » cas-server-core-webflow153 usages
Computed from the dependency graph of build 20261125.0317 (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.
