Mongoose: `sanitizeFilter` bypass via MongoDB internal top-level query operators such as `$_internalSchemaXor`
Affects mongooseSource GCVE Database
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
Thin evidence
One scorer or none| CNA (GitHub_M) | CVSS 3.1 | 6.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:NExploitation evidence
Disclosed: evidence found.
CVE published 2 Dec 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by 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
| Product | Affected | Fixed in |
|---|---|---|
| npmmongoose | Affected
| Fixed in
|
| npmmongoose | Affected
| Fixed in
|
| npmmongoose | Affected
| Fixed in
|
| npmmongoose | Affected
| Fixed in
|
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
- github.com/Automattic/mongoose/security/advisories/GHSA-25v4-hrwm-qj9f (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2026-142595 (opens in a new tab)
- github.com/Automattic/mongoose/commit/34e76947cc8a9ceb916c233aec01aea060bc3dba (opens in a new tab)
- github.com/Automattic/mongoose/commit/3e5f4c8b30ef42db1ab9f2794dc77c95f21d3835 (opens in a new tab)
- github.com/Automattic/mongoose/commit/4627d2fc572a943ee7afe26a1bcebe493dbd2508 (opens in a new tab)
- github.com/Automattic/mongoose/commit/c6a4c95f9b15d81a352f2934c91b64ece583c2db (opens in a new tab)
- github.com/Automattic/mongoose (opens in a new tab)
- github.com/Automattic/mongoose/releases/tag/7.8.14 (opens in a new tab)
- github.com/Automattic/mongoose/releases/tag/8.24.10 (opens in a new tab)
- github.com/Automattic/mongoose/releases/tag/9.12.2 (opens in a new tab)