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

> Attackers can bypass query sanitization via the $nor operator to inject malicious NoSQL queries, potentially reading or modifying data.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 May 2026
- **Updated:** 14 May 2026
- **Also known as:** BIT-mongoose-2026-42334, CLSA-2026-1783558972, GHSA-wpg9-53fq-2r8h, ROOT-APP-NPM-CVE-2026-42334

## What is CVE-2026-42334?

CVE-2026-42334 is a high-severity SQL injection vulnerability in Automattic mongoose, published on 14 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component)

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

9 open source packages ship an affected version, including mongoose. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mongoose` | Bitnami | All versions | 6.13.9, 7.8.9, 8.22.1, 9.1.6 |
| `mongoose` | npm | All versions | 6.13.9 |
| `mongoose` | npm | All versions | 6.13.9 |
| `mongoose` | npm | From 7.0.0 | 7.8.9 |
| `mongoose` | npm | From 7.0.0 | 7.8.9 |
| `mongoose` | npm | From 8.0.0 | 8.22.1 |
| `mongoose` | npm | From 8.0.0 | 8.22.1 |
| `mongoose` | npm | From 9.0.0 | 9.1.6 |
| `mongoose` | npm | From 9.0.0 | 9.1.6 |

Products: Mongoosejs Mongoose.

## How do I fix CVE-2026-42334?

Upgrade mongoose to a fixed version for your release line: 6.13.9, 7.8.9, 8.22.1 or 9.1.6.

## Is CVE-2026-42334 being exploited?

There is no known exploitation of CVE-2026-42334 in the wild and no public exploit code.

## Other vulnerabilities in Automattic mongoose

- [CVE-2023-3696](https://insights.sbomify.com/CVE-2023-3696/): Prototype Pollution in automattic/mongoose (critical 10.0)
- [CVE-2024-53900](https://insights.sbomify.com/CVE-2024-53900/): Mongoose search injection vulnerability (critical 9.1)
- [CVE-2019-17426](https://insights.sbomify.com/CVE-2019-17426/): Improper Input Validation in Automattic Mongoose (critical 9.1)
- [CVE-2025-23061](https://insights.sbomify.com/CVE-2025-23061/): Mongoose search injection vulnerability (critical 9.0)
- [CVE-2022-2564](https://insights.sbomify.com/CVE-2022-2564/): Prototype Pollution in automattic/mongoose (high 7.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-42334 and fix it if it is affected.

What it is: CVE-2026-42334 is a high-severity SQL injection vulnerability in Automattic mongoose, published on 14 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-42334 in the wild and no public exploit code.

Affected packages and fixed versions:
- mongoose (Bitnami): affected all versions; fixed in 6.13.9, 7.8.9, 8.22.1, 9.1.6
- mongoose (npm): affected all versions; fixed in 6.13.9
- mongoose (npm): affected all versions; fixed in 6.13.9
- mongoose (npm): affected from 7.0.0; fixed in 7.8.9
- mongoose (npm): affected from 7.0.0; fixed in 7.8.9
- mongoose (npm): affected from 8.0.0; fixed in 8.22.1
- mongoose (npm): affected from 8.0.0; fixed in 8.22.1
- mongoose (npm): affected from 9.0.0; fixed in 9.1.6
- mongoose (npm): affected from 9.0.0; fixed in 9.1.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-42334/ (Markdown: https://insights.sbomify.com/CVE-2026-42334/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-42334
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-42334
- OSV: https://osv.dev/vulnerability/CVE-2026-42334

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-42334/
Summaries are generated and may contain mistakes; the official description above is the record.
