Loading advisory.
Loading advisory.
Mongoose's Improper Sanitization of $nor in sanitizeFilter May Allow NoSQL Injection
This vulnerability allows bypassing Mongoose’s sanitizeFilter query sanitization mechanism via the $nor operator.
Published 2026-05-05 21:48 UTC · Modified 2026-05-18 08:11 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| mongoose | npm | < 6.13.9 >= 7.0.0, < 7.8.9 >= 8.0.0, < 8.22.1 >= 9.0.0, < 9.1.6 | 6.13.9, 7.8.9, 8.22.1, 9.1.6 | npm install mongoose@6.13.9npm install mongoose@7.8.9npm install mongoose@8.22.1npm install mongoose@9.1.6 |
This vulnerability allows bypassing Mongoose’s sanitizeFilter query sanitization mechanism via the $nor operator.
When sanitizeFilter is enabled, Mongoose wraps query operators in $eq to neutralize them. However, prior to the fix, $nor was not included in the set of logical operators that are recursively sanitized. Because $nor accepts an array (like $and and $or), and arrays do not trigger hasDollarKeys(), malicious operators such as $ne, $gt, or $regex could be injected inside a $nor clause without being sanitized.
This may lead to:
Authentication bypass
Unauthorized data access
Data exfiltration
Affected users:
Applications that:
Explicitly enable sanitizeFilter
Pass unsanitized user-controlled input directly into query methods (e.g., Model.findOne(req.body)) and rely on sanitizeFilter to strip out query selectors
Applications that validate input schemas, whitelist fields, or avoid passing raw request bodies into queries are not affected. For example, Model.findOne({ user: req.body.user, pwd: req.body.pwd }) is not affected.
Patches have been released for all supported Mongoose release lines:
^6.13.9
^7.8.9
^8.22.1
^9.1.6
Delete $nor keys, use an additional schema validation library, or write middleware to strip out $nor from query filters.
sanitizeFilter documentation: https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.sanitizeFilter()
Original blog post on sanitizeFilter: https://thecodebarbarian.com/whats-new-in-mongoose-6-sanitizefilter.html
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.003 on 2026-11-24 to 0.005 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.003 | first score | v2026.06.15 |
| 2026-11-26 | 0.005 | 0.003 | v2026.06.15 |