{"id":"CVE-2026-142596","summary":"Mongoose: sanitizeProjection can be bypassed to include fields deselected with `select: false`","details":"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.","aliases":["GHSA-xfcm-rmv3-crmq"],"modified":"2026-12-02T23:00:11.675737296Z","published":"2026-12-02T21:50:31.552Z","database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-200"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142596.json"},"references":[{"type":"FIX","url":"https://github.com/Automattic/mongoose/commit/c369da407ee8bea907bb5af7bb94ce5deeb3e0e4"},{"type":"FIX","url":"https://github.com/Automattic/mongoose/commit/c5483b71438ececde3a272feef65e14666614093"},{"type":"WEB","url":"https://github.com/Automattic/mongoose/releases/tag/8.24.10"},{"type":"WEB","url":"https://github.com/Automattic/mongoose/releases/tag/9.12.2"},{"type":"ADVISORY","url":"https://github.com/Automattic/mongoose/security/advisories/GHSA-xfcm-rmv3-crmq"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142596.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142596"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/automattic/mongoose","events":[{"introduced":"c4c932a03ab3eeaef760dca4f6d60a738af58dc7"},{"fixed":"f8666d81080a6699e5274d8488c690b4c8171ed6"},{"introduced":"93c780b6e1c24a6b4ab42c14e64a2500da87a54b"},{"fixed":"a8204d30c4db4ba1138bc75a879c79cf5127670d"},{"fixed":"c369da407ee8bea907bb5af7bb94ce5deeb3e0e4"},{"fixed":"c5483b71438ececde3a272feef65e14666614093"}],"database_specific":{"extracted_events":[{"strategy":"StringRangeExpression","range":[{"introduced":"8.5.0"},{"fixed":"8.24.10"}],"source":"AFFECTED_FIELD"},{"source":"AFFECTED_FIELD","strategy":"StringRangeExpression","range":[{"introduced":"9.0.0"},{"fixed":"9.12.2"}]},{"source":"REFERENCES_COMMIT","range":[{"fixed":"c369da407ee8bea907bb5af7bb94ce5deeb3e0e4"}]},{"range":[{"fixed":"c5483b71438ececde3a272feef65e14666614093"}],"source":"REFERENCES_COMMIT"},{"source":"REFERENCES_TAG","original_tag":"8.24.10","range":[{"fixed":"f8666d81080a6699e5274d8488c690b4c8171ed6"}]},{"range":[{"fixed":"a8204d30c4db4ba1138bc75a879c79cf5127670d"}],"source":"REFERENCES_TAG","original_tag":"9.12.2"}]}}],"versions":["8.24.9","9.12.1","8.24.8","9.12.0","9.11.5","8.24.7","9.11.4","9.11.3","8.24.6","8.24.5","9.11.2","9.11.1","9.11.0","9.10.4","9.10.3","9.10.2","9.10.1","9.10.0","9.9.5","8.24.4","9.9.4","8.24.3","9.9.3","9.9.2","8.24.2","9.9.1","9.9.0","9.8.1","9.8.0","9.7.4","9.7.3","8.24.1","9.7.2","9.7.1","9.7.0","9.6.3","8.24.0","9.6.2","8.23.1","9.5.0","9.4.1","9.4.0","9.3.3","9.3.2","9.3.1","8.23.0","9.3.0","9.2.4","9.2.3","9.2.2","9.2.0","9.2.1","9.1.6","8.22.1","8.22.0","8.21.1","9.1.5","9.1.4","8.21.0","9.1.3","9.1.2","9.1.1","9.1.0","8.20.4","9.0.2","8.20.3","9.0.1","8.20.2","9.0.0","8.20.1","8.20.0","8.19.4","8.19.3","8.19.2","8.19.1","8.19.0","8.18.3","8.18.2","8.18.1","8.17.1","8.18.0","8.17.2","8.17.0","8.16.5","8.16.4","8.16.3","8.16.2","8.16.1","8.16.0","8.15.2","8.15.1","8.15.0","8.14.3","8.14.2","8.14.1","8.14.0","8.13.3","8.13.2","8.13.1","8.13.0","8.12.2","8.12.1","8.12.0","8.11.0","8.10.2","8.10.1","8.10.0","8.9.7","8.9.6","8.9.5","8.9.4","8.9.3","8.9.2","8.9.1","8.9.0","8.8.4","8.8.3","8.8.2","8.8.0","8.8.1","8.7.3","8.7.2","8.7.1","8.7.0","8.6.4","8.6.3","8.6.2","8.6.0","8.6.1","8.5.5","8.5.4","8.5.3","8.5.2","8.5.1","8.5.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142596.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"}]}