CVE-2026-59342: Spring Data MongoDB String query logic injection via function operator bind parameter
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 Software
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
An application is exposed only when MongoDB server-side JavaScript functions are enabled, untrusted input is passed as a String repository-method argument without sanitization, and an annotated MQL template uses that placeholder within a script expression such as $accumulator, $function, or $where.
Does an attacker need credentials or user interaction to exploit it?
The supplied CVSS vector indicates no privileges are required and no user interaction is required. Exploitation nevertheless has high attack complexity and depends on reaching an affected repository query path with attacker-controlled input.
What should teams review if they cannot immediately apply an update?
Review @Query and @Aggregation repository methods for String value placeholders embedded in JavaScript-capable MQL expressions, including $accumulator, $function, and $where. Remove or avoid passing untrusted String input into those placeholders, sanitize such input before use, and disable MongoDB server-side JavaScript functions where feasible.
How can teams determine whether they are currently affected?
Identify whether server-side JavaScript functions are enabled in MongoDB, then inspect annotated repository query and aggregation templates. The affected pattern requires a quoted string literal containing a value placeholder within a script expression and an untrusted String argument bound to that placeholder.