Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') Affecting mongoose package, versions <6.13.9>=7.0.0-rc0 <7.8.9>=8.0.0-rc0 <8.22.1>=9.0.0-rc0 <9.1.6


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.04% (11th 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 IDSNYK-JS-MONGOOSE-16425765
  • published6 May 2026
  • disclosed5 May 2026
  • creditJeremy Katz

Introduced: 5 May 2026

NewCVE-2026-42334  (opens in a new tab)
CWE-74  (opens in a new tab)

How to fix?

Upgrade mongoose to version 6.13.9, 7.8.9, 8.22.1, 9.1.6 or higher.

Overview

mongoose is a Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment.

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') in the sanitizeFilter function. An attacker can gain unauthorized access to sensitive data by injecting malicious query operators inside a $nor clause when user-controlled input is passed directly into query methods.

Note: This is only exploitable if the application explicitly enables the sanitization feature and passes unsanitized user input directly into query methods without additional input validation.

Workaround

This vulnerability can be mitigated by deleting $nor keys from user input, using an additional schema validation library, or writing middleware to strip out $nor from query filters.

CVSS Base Scores

version 4.0
version 3.1