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


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.26% (17th percentile)

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 Learn

Learn about Improper Neutralization of Special Elements in Data Query Logic vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JAVA-ORGSPRINGFRAMEWORKDATA-17326247
  • published12 Jun 2026
  • disclosed9 Jun 2026
  • creditUnknown

Introduced: 9 Jun 2026

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

How to fix?

Upgrade org.springframework.data:spring-data-mongodb to version 4.5.12, 5.0.6 or higher.

Overview

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements in Data Query Logic via the @Query regex parameter binding when a bound parameter is placed inside a regular expression literal using \\Q...\\E quoting (e.g. @Query(\"{ name : /^\\\\Q?0\\\\E$/ }\")). The ParameterBindingJsonReader performs insufficient neutralization of the bound parameter value when it is substituted into the regex literal. Because escaping was applied via replaceAll (which interprets regex metacharacters in both the pattern and replacement), a bound value containing a \\E sequence (or other regex-significant characters) can terminate the intended \\Q literal-quoting context and break out into attacker-controlled regular expression syntax. This lets an attacker inject regex constructs into the query filter, manipulating the matching logic to bypass the intended filter or match documents outside the intended scope, which can lead to unauthorized data exposure.

Note:

This is only exploitable if the application exposes a repository query method whose @Query binds an untrusted parameter inside a regex literal.

CVSS Base Scores

version 4.0
version 3.1