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

Published Dec 2, 2026
·
Updated

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.

Affected Software

1 affected component
npm/mongoose>=8.5.0<8.24.10, >=9.0.0<9.12.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Mongoose to a version that resolves this vulnerability.

    Fixed in 8.24.10
  2. Upgrade

    Upgrade Mongoose to a version that resolves this vulnerability.

    Fixed in 9.12.2

Event History

Dec 2, 2026
CVE Published
via MITRE·09:50 PM
Data Sourced
via MITRE·09:50 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are most exposed to this issue?

Applications are exposed when they pass attacker-controlled projection data to select(), find(filter, projection), or the projection option and rely on sanitizeProjection. Successful exploitation can expose fields configured with select: false, such as password hashes, reset tokens, API keys, and nested secrets.

2

Can applications be affected even if they do not enable sanitizeProjection?

Yes. Nested exclusion objects, $elemMatch used with an exclusion or a cast error, and discriminator filters can cause ordinary queries to omit the select: false exclusions that Mongoose normally adds.

3

What projection patterns are relevant for triage?

Relevant patterns include +path selections, object or array aggregation expressions, nested or parent projections, positional projections, $meta, discriminator-specific exclusions, an own __proto__ key, and projection-cast error paths. Review endpoints that allow clients to influence any of these projection forms.

4

Which versions contain the fix?

The issue is fixed in Mongoose 8.24.10 and 9.12.2. The affected range is from 8.5.0 until those fixed releases.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203