# CVE-2026-42334: Mongoose: Improper Sanitization of $nor in sanitizeFilter May Allow NoSQL Injection

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.46% (percentile 32, 2026-11-26)
- **CWE:** CWE-74
- **Aliases:** BIT-mongoose-2026-42334, GHSA-wpg9-53fq-2r8h
- **Published:** 2026-05-05T21:48:06.000Z
- **Modified:** 2026-10-26T14:10:00.130Z

## Who should check

- Projects that depend on npm package mongoose (\< 6.13.9)
- Anyone running Automattic mongoose \< 6.13.9; \>= 7.0.0, \<= 7.8.8; \>= 8.0.0, \<= 8.22.0; \>= 9.0.0, \<= 9.1.5

## Description

Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Prior to 6.13.9, 7.8.9, 8.22.1, and 9.1.6, a 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 vulnerability is fixed in 6.13.9, 7.8.9, 8.22.1, and 9.1.6.

## Affected and fixed versions

- npm `mongoose`: affected \< 6.13.9; fixed 6.13.9, 7.8.9, 8.22.1, 9.1.6 (osv)
- Automattic mongoose: \< 6.13.9; \>= 7.0.0, \<= 7.8.8; \>= 8.0.0, \<= 8.22.0; \>= 9.0.0, \<= 9.1.5 (cvelist)

## Mitigation

- Upgrade mongoose to one of 6.13.9, 7.8.9, 8.22.1, 9.1.6 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-42334. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-42334.md
Affected: mongoose < 6.13.9
Fixed in: 6.13.9, 7.8.9, 8.22.1, 9.1.6

Steps:
1. Search this machine and project for mongoose (npm), Automattic mongoose: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-42334 being exploited?

There is no confirmed exploitation: CVE-2026-42334 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.46% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-42334?

High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2026-42334?

mongoose \< 6.13.9.

### Is there a fix for CVE-2026-42334?

Yes. Fixed in 6.13.9, 7.8.9, 8.22.1, 9.1.6. Upgrade mongoose to one of 6.13.9, 7.8.9, 8.22.1, 9.1.6 (or later in the same release line).

### How do I check if I'm affected by CVE-2026-42334?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/Automattic/mongoose/security/advisories/GHSA-wpg9-53fq-2r8h>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2026-42334>
- other: <https://github.com/Automattic/mongoose>
- other: <https://mongoosejs.com/docs/api/mongoose.html#Mongoose.prototype.sanitizeFilter()>
- other: <https://thecodebarbarian.com/whats-new-in-mongoose-6-sanitizefilter.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-42334>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-wpg9-53fq-2r8h> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2026-42334> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-42334>
