# CVE-2026-142595: Mongoose: \`sanitizeFilter\` bypass via MongoDB internal top-level query operators such as \`$\_internalSchemaXor\`

- **Severity:** MEDIUM 6.5
- **CVSS:** 6.5 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: Low; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **CWE:** CWE-943
- **Published:** 2026-12-02T21:47:03.928Z
- **Modified:** 2026-12-02T22:18:37.160Z

> **AI summary (AI-generated, claude-haiku-5-5):** An attacker can bypass Mongoose sanitizeFilter using undocumented MongoDB internal top-level operators, injecting nested selectors like $ne or $regex to bypass authentication or read or modify data.

## Who should check

- Anyone running Automattic mongoose \>= 6.0.0, \< 6.13.13; \>= 7.0.0, \< 7.8.14; \>= 8.0.0, \< 8.24.10; \>= 9.0.0, \< 9.12.2

## Description

Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. From 6.0.0 until 6.13.13, 7.8.14, 8.24.10, and 9.12.2, Mongoose's sanitizeFilter rejects only a small named set of top-level operators and does not recursively inspect undocumented operators such as $\_internalSchemaXor and $\_internalSchemaCond. Applications that pass attacker-controlled filter keys to queries while relying on sanitizeFilter can therefore accept nested selectors such as $ne or $regex, allowing authentication bypass, disclosure of protected values through boolean queries, or unintended updates and deletions. Applications that construct filters from individual primitive values are not affected by this bypass. This issue is fixed in versions 6.13.13, 7.8.14, 8.24.10, and 9.12.2.

## Affected and fixed versions

- Automattic mongoose: \>= 6.0.0, \< 6.13.13; \>= 7.0.0, \< 7.8.14; \>= 8.0.0, \< 8.24.10; \>= 9.0.0, \< 9.12.2 (cvelist)

## Technologies

MongoDB (AI-matched), npm packages (AI-matched)

## Mitigation

- Upgrade mongoose to 9.12.2 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2026-142595.md
Affected: Automattic mongoose >= 6.0.0, < 6.13.13; >= 7.0.0, < 7.8.14; >= 8.0.0, < 8.24.10; >= 9.0.0, < 9.12.2
Fixed in: Automattic mongoose 6.13.13, Automattic mongoose 7.8.14, Automattic mongoose 8.24.10, Automattic mongoose 9.12.2

Steps:
1. Search this machine and project for 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-142595 being exploited?

There is no confirmed exploitation: CVE-2026-142595 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

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

Medium: CVSS 6.5 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.

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

Automattic mongoose \>= 6.0.0, \< 6.13.13; \>= 7.0.0, \< 7.8.14; \>= 8.0.0, \< 8.24.10; \>= 9.0.0, \< 9.12.2.

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

Yes. Fixed in Automattic mongoose 6.13.13, Automattic mongoose 7.8.14, Automattic mongoose 8.24.10, Automattic mongoose 9.12.2. Upgrade mongoose to 9.12.2 or later.

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

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-25v4-hrwm-qj9f>
- patch: <https://github.com/Automattic/mongoose/commit/34e76947cc8a9ceb916c233aec01aea060bc3dba>
- patch: <https://github.com/Automattic/mongoose/commit/3e5f4c8b30ef42db1ab9f2794dc77c95f21d3835>
- patch: <https://github.com/Automattic/mongoose/commit/4627d2fc572a943ee7afe26a1bcebe493dbd2508>
- patch: <https://github.com/Automattic/mongoose/commit/c6a4c95f9b15d81a352f2934c91b64ece583c2db>
- other: <https://github.com/Automattic/mongoose/releases/tag/7.8.14>
- other: <https://github.com/Automattic/mongoose/releases/tag/8.24.10>
- other: <https://github.com/Automattic/mongoose/releases/tag/9.12.2>

## 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-142595>

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