Mongoose: sanitizeProjection can be bypassed to include fields deselected with `select: false`
- CVE-2026-142596
- GHSA-xfcm-rmv3-crmq
- EUVD-2026-141931
Description
Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. From 8.5.0 until 8.24.10 and 9.12.2, Mongoose's sanitizeProjection can be bypassed by +path selections, object or array aggregation expressions, nested and parent projections, positional projections, $meta, discriminator-specific exclusions, an own __proto__ key, and projection-cast error paths. Applications that pass attacker-controlled data to select(), find(filter, projection), or the projection option while relying on sanitizeProjection can return fields marked select: false, including password hashes, reset tokens, API keys, and nested secrets. Nested exclusion objects, $elemMatch combined with an exclusion or a cast error, and discriminator filters can also cause ordinary queries that do not enable sanitizeProjection to omit the select: false exclusions that Mongoose normally adds. This issue is fixed in versions 8.24.10 and 9.12.2.
Text from the CVE.org record.
Recommendation
mongoose
- If you run a version from 9.0.0 to before 9.12.2update to 9.12.2 or laterMinor version change: check the release notesmongoose 9.12.2 on its registry (opens in a new tab)
- If you run a version from 8.5.0 to before 8.24.10update to 8.24.10 or laterMinor version change: check the release notesmongoose 8.24.10 on its registry (opens in a new tab)
Taken from the version ranges the sources state. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
Automattic mongoose
Affected versions Fixed in >= 8.5.0, < 8.24.10 none stated >= 9.0.0, < 9.12.2 none stated mongoosenpm
Affected versions Fixed in from 9.0.0 to before 9.12.2 9.12.2 from 8.5.0 to before 8.24.10 8.24.10
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.