Improper Neutralization of Special Elements in Data Query Logic Affecting org.springframework.data:spring-data-mongodb package, versions [,5.0.9)[5.1.0-M1,5.1.3)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-ORGSPRINGFRAMEWORKDATA-22731232
  • published22 Nov 2026
  • disclosed19 Nov 2026
  • creditTim Zheng

Introduced: 19 Nov 2026

NewCVE-2026-59342  (opens in a new tab)
CWE-943  (opens in a new tab)

How to fix?

Upgrade org.springframework.data:spring-data-mongodb to version 5.0.9, 5.1.3 or higher.

Overview

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements in Data Query Logic in the ParameterBindingJsonReader class, which binds a String argument into an MQL @Query or @Aggregation placeholder without escaping it for the surrounding quoted string literal. A user supplying a repository method argument that contains a quote or JavaScript metacharacter can break out of the literal and alter the query when the placeholder sits inside a server-side script operator such as $where, $function, or $accumulator. Exploitation requires MongoDB server-side JavaScript to be enabled and the application to pass untrusted input to such a templated query method without sanitization.

Workaround

This vulnerability can be avoided by disabling MongoDB server-side JavaScript (security.javascriptEnabled: false), which removes the $where/$function/$accumulator execution the injection relies on.

CVSS Base Scores

version 4.0
version 3.1