Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreSpring 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:
@Query, @Aggregation) that uses a value placeholder inside a script expression (e.g. $accumulator, $function, $where, ...)Spring Data MongoDB:
| Fix version | Availability |
|---|---|
| 5.1.3 | OSS |
| 5.1.2.1 | Enterprise Support Only |
| 5.0.9 | OSS |
| 5.0.8.1 | Enterprise Support Only |
| 4.5.15 | Enterprise Support Only |
| 4.4.17 | Enterprise Support Only |
| 3.4.22 | Enterprise Support Only |
Upgrade to the latest supported version and enclose placeholders intended to receive String value inside quotes to enforce escaping.
Example:
@Query("{ $where : 'return this.firstname == \"?0\"' }")
The issue was reported responsibly by Tim Zheng (tim.zheng) - https://github.com/EaEa0001
To report a security vulnerability for a project within the Spring portfolio, see the Security Policy