Skip to content

CVE-2026-142596 Mongoose: sanitizeProjection can be bypassed to include fields deselected with `select: false`

HighCVSS 7.5
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: yes · technical impact: partial

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.

Upgrade path

2 packages: 1 fixed.

PackageAffectedFixed inStatus
npm mongoose(npm) >= 8.5.0, < 8.24.10; >= 9.0.0, < 9.12.2 8.24.10, 9.12.2 Fixed
automattic mongoose = >= 8.5.0, < 8.24.10; = >= 9.0.0, < 9.12.2 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
automattic mongoose = >= 8.5.0, < 8.24.10 No fix listed
automattic mongoose = >= 9.0.0, < 9.12.2 No fix listed
npm mongoose(npm) >= 8.5.0, < 8.24.10 8.24.10
npm mongoose(npm) >= 9.0.0, < 9.12.2 9.12.2

References