CVE-2026-41696: Spring Data MongoDB Regex Parameter Binding Injection Vulnerability
Summary
CVE-2026-41696: Spring Data MongoDB Has Regex Parameter Binding Injection in @Query Repository Methods. Affects org.springframework.data:spring-data-mongodb across 5 version ranges.
< 3.4.19
>= 4.0.0, <= 4.3.16
>= 4.4.0, <= 4.4.14
>= 4.5.0, < 4.5.12
>= 5.0.0, < 5.0.6
Fixed in 3.4.19, 4.5.12 or 5.0.6, depending on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Spring Data MongoDB is a powerful framework that simplifies the integration of MongoDB with Spring applications. It provides a repository abstraction for data access, allowing developers to perform CRUD operations easily. However, certain versions of this package are vulnerable to regex parameter binding injection, which can lead to unintended query execution and data exposure.
Vulnerability Detail
The vulnerability arises from insufficient validation of bound parameters in repository query methods annotated with @Query. An attacker can exploit this weakness by supplying a specially crafted string that breaks out of the intended regular expression quoting. This can lead to unauthorized access to data or manipulation of queries, posing a significant security risk.
How To Fix
Latest published version: 5.2.0-RC1 as of 23 Oct 2026
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 3.4.193.4.19 -
>= 4.5.0, < 4.5.124.5.12 -
>= 5.0.0, < 5.0.65.0.6
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary measure, avoid using regex parameter binding in @Query methods until the package is updated. Instead, consider using alternative query methods that do not involve regex or validate the input thoroughly before passing it to the query.
Conclusion
The Spring Data MongoDB regex parameter binding injection vulnerability (CVE-2026-41696) poses a significant risk to applications using affected versions. It is crucial to update to the patched versions to mitigate this risk and ensure the security of your application.
See every vulnerability recorded for org.springframework.data:spring-data-mongodb →
FAQ
CVE-2026-41696 is a vulnerability in Spring Data MongoDB that allows for regex parameter binding injection due to insufficient validation of input parameters.
Affected versions include Spring Data MongoDB 5.0.0 through 5.0.5, 4.5.0 through 4.5.11, and several others down to 3.4.0.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software by analyzing the pom.xml file. You can also check your application at the Vulert playground without signup.
The CVSS score for this vulnerability is 5.9, indicating a moderate severity level.
If immediate updates are not possible, avoid using regex parameter binding in your queries and validate all inputs thoroughly.
References
Related vulnerabilities
Recent vulnerabilities recorded for org.springframework.data:spring-data-mongodb.