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` | | `select('+secrets')` | `+path` was not blocked for map paths | | `select({ name: { $concat: ['$password'] } })`, `select({ name: ['$password'] })` | Object and array values are aggregation expressions; only string values were sanitized | | `select({ tags: { $slice: ['$recoveryCodes', 1] } })` | A two-element `$slice` with an expression is an aggregation expression | | `select({ name: { $meta: 'sortKey' } }).sort({ password: 1 })`, `{ $meta: 'indexKey' }` | `$meta` returned sort and index key values | | `select({ name: '$password' })` called before `sanitizeProjection(true)` | String values were only sanitized if the option was set first | | `select({ profile: { ssn: 1 } })`, `select({ profile: { bio: '$password' } })` |
Properties
- Severity
- high
- Summary
- Mongoose: sanitizeProjection can be bypassed to include fields deselected with `select: false`
- Nvd fetched at
- 2026-12-04T15:00:48.841578+00:00
- Epss score
- 0.00685
- Cvss severity
- HIGH
- Cvss score
- 7.5
- Retrieved at
- 2026-12-04T15:02:58+00:00
- Ghsa published
- 2026-12-04T00:02:36Z
- Source url
- https://github.com/advisories/GHSA-xfcm-rmv3-crmq
- Ghsa updated
- 2026-12-04T00:02:39Z
- Ghsa id
- GHSA-xfcm-rmv3-crmq
- Last source
- FIRST EPSS
- Score
- 7.5
- Cvss version
- 3.1
- Cve id
- CVE-2026-142596
- Cvss vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- First seen by Signal
- 2026-12-02T22:45:38+00:00
- Name
- CVE-2026-142596
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Related Entities (3)
AFFECTS (1)
HAS_WEAKNESS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph