Skip to main content
CVE-2026-142595VulnerabilityPublished

Mongoose: `sanitizeFilter` bypass via MongoDB internal top-level query operators such as `$_internalSchemaXor`

Affects mongooseSource GCVE Database

0
Compare
Authoritative record:CVE-2026-142595· Medium 6.5

Not known to be exploited · CVSS 6.5 Medium : upgrade to 6.13.13 when convenient.

Data as of 4 Dec 2026, 00:45 UTC

CVSS 3.1 base score
6.5Medium
How severe the flaw is on the 0–10 CVSS scale.

Thin evidence

One scorer or none
CVSS scores by source
CNA (GitHub_M)CVSS 3.16.5
Patch
Available – fixed in 6.13.13, 7.8.14, 8.24.10 +1
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 2 Dec 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 3 Dec 2026.

What to do

Upgrade to a fixed release listed under Affected software.

Affected software

ProductAffectedFixed in
npmmongooseAffected
  • <6.13.13
Fixed in
  • 6.13.13
npmmongooseAffected
  • >=7.0.0 <7.8.14
Fixed in
  • 7.8.14
npmmongooseAffected
  • >=8.0.0 <8.24.10
Fixed in
  • 8.24.10
npmmongooseAffected
  • >=9.0.0 <9.12.2
Fixed in
  • 9.12.2

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A patch is available and should be applied by upgrading to Mongoose versions 6.13.13, 7.8.14, 8.24.10, or 9.12.2 or later. The fix enhances sanitizeFilter to reject all top-level $-prefixed keys except $and, $or, and $nor, and properly inspects nested filters. Applications should avoid relying solely on sanitizeFilter for security and ensure that user input is validated and sanitized appropriately. No additional mitigation is required beyond applying the official fix.

Description

Mongoose's sanitizeFilter option, designed to block query selector injection, was bypassable via MongoDB internal top-level query operators like $_internalSchemaXor and $_internalSchemaCond. These operators accept nested filters which sanitizeFilter did not inspect, allowing attackers controlling query keys to inject arbitrary query selectors such as $ne or $regex. This flaw enables authentication bypass, data extraction, and unintended document modifications in affected applications. The issue affects Mongoose versions prior to 6.13.13, between 7.0.0 and before 7.8.14, between 8.0.0 and before 8.24.10, and between 9.0.0 and before 9.12.2. A fix is available in versions 6.13.13, 7.8.14, 8.24.10, and 9.12.2.

References

Community reviews

Loading reviews…