Mongoose: sanitizeProjection can be bypassed to include fields deselected with `select: false`
CVE-2026-142596
Summary Since Mongoose 8.5.0, the sanitizeProjection option prevents untrusted projections from including fields that the schema deselects with select: false, like password hashes and reset tokens. Several projection forms got around that check, so a user-controlled projection could still return select: false fields even with sanitizeProjection enabled. Mongoose versions before 8.5.0 do not make sanitizeProjection block including select: false keys - hiding select: false keys was a new feature introduced in Mongoose 8.5.0. Details Given: javascript const User = mongoose.model('User', new Schema({ name: String, password: { type: String, select: false }, profile: { bio: String, ssn: { type: String, select: false } }, secrets: { type: Map, of: String, select: false }, recoveryCodes: { type: [String], select: false }, tags: [String], comments: [{ text: String, secret: { type: String, select: false } }] })); each of the following returned select: false data with sanitizeProjection enabled: | Projection | Why it got through | | --- | --- | | select('-name +password') | +path was only blocked in inclusive projections | | select('-+password') | Collapsing - paths turned it into +password…
Assessment
- CVSS
- 7.5 (v3.1)
- Severity
- High
- EPSS
- 0.00685% chance of exploitation in the next 30 days
- Known exploited
- Not listed in CISA KEV
- Exploit availability
- Nothing found in Exploit-DB, Metasploit, Nuclei or public PoC repositories
- Published
- 4 December 2026
- Last updated
- 4 December 2026
- Affected
- Automattic · Mongoose · mongoose
- Weakness
- CWE-200
- Assigner
- GitHub_M
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
At the source
References
- https://github.com/Automattic/mongoose/security/advisories/GHSA-xfcm-rmv3-crmq
- https://nvd.nist.gov/vuln/detail/CVE-2026-142596
- https://github.com/Automattic/mongoose/commit/c369da407ee8bea907bb5af7bb94ce5deeb3e0e4
- https://github.com/Automattic/mongoose/commit/c5483b71438ececde3a272feef65e14666614093
- https://github.com/Automattic/mongoose/releases/tag/8.24.10
- https://github.com/Automattic/mongoose/releases/tag/9.12.2
- https://github.com/advisories/GHSA-xfcm-rmv3-crmq
Community proofs of concept
No community proof of concept yet. If you have one for a published vulnerability and the right to share it, add it below — it will appear here once reviewed.
Submit a proof of concept
Only for publicly disclosed vulnerabilities, and only material from testing you were authorised to perform. This platform does not buy, sell, or broker exploits — see earning from vulnerability research for legitimate bounty programs. Submissions are reviewed before they appear. Text only; do not include live credentials, personal data, or anything targeting systems you are not permitted to test.
Query this programmatically
Agents can read this through the MCP endpoint, or over HTTP:
curl https://cve.zerocrew.in/api/cve/CVE-2026-142596