Skip to content

← Actionable
High, CVSS 7.5amended

Mongoose's Improper Sanitization of $nor in sanitizeFilter May Allow NoSQL Injection

CVE-2026-42334GHSA-wpg9-53fq-2r8h

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (mongoose 9.1.6, 8.22.1, 7.8.9, 6.13.9), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • npm mongoose

    Affected
    < 6.13.9>= 7.0.0, <= 7.8.8>= 8.0.0, <= 8.22.0>= 9.0.0, <= 9.1.5
    Fixed in
    7.8.9, 6.13.9, 8.22.1, 9.1.6

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
EPSS
  • CVE-2026-42334: 0.27% estimated exploitation activity in the next 30 days; percentile 19.87 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Impact 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,…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-wpg9-53fq-2r8h

  2. Revision 1 · created ·

    Published from osv record GHSA-wpg9-53fq-2r8h

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-42334

Advisory: Mongoose's Improper Sanitization of $nor in sanitizeFilter May Allow NoSQL Injection
IDs: CVE-2026-42334, GHSA-wpg9-53fq-2r8h
Record: https://patchnext.com/advisories/cve-2026-42334 (revision 2, source checked 26 Oct 2026, 12:52 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: High (CVSS 7.5)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: mongoose 9.1.6, 8.22.1, 7.8.9, 6.13.9. A vendor fix does not mean a deployment is fixed.

## Affected components
- npm mongoose: affected < 6.13.9; >= 7.0.0, <= 7.8.8; >= 8.0.0, <= 8.22.0; >= 9.0.0, <= 9.1.5; fixed in 7.8.9, 6.13.9, 8.22.1, 9.1.6

## Suggested inspection (read-only)
- `npm ls mongoose --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on mongoose.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-wpg9-53fq-2r8h (OSV record GHSA-wpg9-53fq-2r8h lists affected ranges: npm mongoose >=0 =7.0.0 =8.0.0 =9.0.0 <9.1.6 (fixed))
- Verified: https://github.com/advisories/GHSA-wpg9-53fq-2r8h (GitHub-reviewed advisory GHSA-wpg9-53fq-2r8h lists affected ranges: npm mongoose >=0 =7.0.0 =8.0.0 =9.0.0 <=9.1.5)

Commands are suggestions: review each one before running it.

Loading voting…