CVE-2026-142608: Mongoose: Plain objects with a forged _bsontype bypass ObjectId and String casting, leaking and replaying data from other command
Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. From 6.3.5 until 6.13.13, Mongoose treats a plain object with an own bsontype property as a BSON value, allowing forged ObjectID values to replay an identifier from a preceding database command when that command has a compatible layout and buffer offset, or to store and disclose other command-buffer fragments, while forged BSONRegExp values bypass String-path filtering. Applications that pass request-derived values into ObjectId or String queries and writes can consequently read, modify, or delete documents accessed by another request under the compatible-layout condition, store and disclose fragments such as reset codes or API keys without that identifier-replay condition, or execute unintended regular-expression matches even when sanitizeFilter or common MongoDB sanitizers are enabled. This issue is fixed in version 6.13.13.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.13.13
Event History
Frequently Asked Questions
Which applications are exposed in practice?
Applications using Mongoose versions from 6.3.5 through 6.13.12 are exposed if they pass request-derived values into queries or writes for ObjectId or String paths. No authentication or user interaction is required according to the supplied vector.
Do filter sanitizers prevent exploitation?
No. Forged BSONRegExp values can bypass String-path filtering even when sanitizeFilter or common MongoDB sanitizers are enabled.
What could happen if an attacker supplies a forged value?
Under a compatible command layout and buffer offset, a forged ObjectID can replay an identifier from a preceding database command, potentially allowing reads, modifications, or deletions of documents accessed by another request. Forged values may also cause command-buffer fragments, including reset codes or API keys, to be stored or disclosed.
What version fixes the issue?
Upgrade to Mongoose 6.13.13, which is identified as the fixed version.