
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-142608 is a type confusion vulnerability in Mongoose, the MongoDB object modeling library for Node.js, where plain JavaScript objects with a forged _bsontype own property bypass ObjectId and String casting. Affected versions span from 6.3.5 through 6.13.12 (inclusive); the issue is fixed in version 6.13.13. The vulnerability was published by researcher vkarpov15 on November 23, 2026, and added to the GitHub Advisory Database on December 3, 2026. The assigned CVSS v3.1 base score is 0.0 (Low) per the official advisory, though Feedly's category estimate rates the real-world impact as HIGH due to the authorization bypass potential (Github Advisory, Mongoose Advisory).
The root cause is a type confusion flaw (CWE-843) in lib/helpers/isBsonType.js, which determined whether a value was a BSON type solely by checking if its _bsontype property matched a target typename — without distinguishing between own properties and prototype-inherited ones. Since legitimate BSON objects (from the bson 4.x library) define _bsontype on the prototype, a plain object like {"_bsontype":"ObjectID","id":""} — easily crafted from JSON request bodies, cookies, or Express 4 query strings — would pass the ObjectId cast. When bson 4.x serializes such a forged ObjectID, it writes no id bytes but still advances 12 bytes in its internal buffer, causing the serialized value to contain whatever bytes the previous MongoDB command left at that offset. Three distinct attack primitives result: (1) ID replay — findById(forged) queries using the _id from the preceding command; (2) buffer disclosure — writes via create() or $set store 12 bytes of prior command data (e.g., emails, reset codes, API keys) in the document; (3) regex bypass — a forged BSONRegExp object passes String-path filtering and executes as a regex even when sanitizeFilter is enabled (Github Advisory, Patch Commit).
Successful exploitation allows unauthenticated remote attackers to read, modify, or delete MongoDB documents belonging to other concurrent requests when a compatible buffer layout exists, effectively enabling cross-request data access without authentication. Sensitive command-buffer fragments — including password reset codes, API keys, email addresses, and other field values — can be stored in documents and later retrieved by any user with read access, even in default configurations. Additionally, attackers can force unintended regular-expression matches against String fields, bypassing sanitizeFilter, express-mongo-sanitize, and mongo-sanitize protections entirely (Github Advisory, Mongoose Advisory).
No public proof-of-concept exploit code has been published, and there is no evidence of in-the-wild exploitation at this time (Github Advisory). The EPSS score is 0.0, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. However, exploitation requires only the ability to send crafted HTTP requests (e.g., JSON bodies with a _bsontype key) to an application that passes request-derived values into Mongoose ObjectId or String queries — a low-complexity, unauthenticated attack vector. The bypass works even when common sanitization libraries are in use, lowering the effective barrier for exploitation.
_bsontype property: {"_bsontype":"ObjectID","id":""}. This can be submitted via a JSON request body, cookie, or Express 4 query string parameter.findById(), findByIdAndDelete(), or findByIdAndUpdate() with the forged object as the ID parameter. Mongoose passes it through the ObjectId cast, and bson 4.x serializes it using 12 bytes from the previous command's buffer — effectively querying or modifying the document accessed by the preceding request.create() or $set on an ObjectId path). The stored field will contain 12 bytes of the previous command's buffer (e.g., fragments of filter values, reset codes, or API keys). Retrieve the document to read the leaked bytes.{"_bsontype":"BSONRegExp","pattern":"^S3","options":""}. Submit it as the value for a String-typed query field. Mongoose passes it through String casting and sends it as a regex to MongoDB, bypassing sanitizeFilter and enabling pattern-based data enumeration (Github Advisory, Mongoose Advisory)._bsontype key (e.g., {"_bsontype":"ObjectID","id":""} or {"_bsontype":"BSONRegExp","pattern":"...","options":""}); unexpected cross-user document access patterns in application logs._bsontype in fields expected to be primitive strings or ObjectId hex strings; MongoDB query logs showing regex queries on String fields from unexpected sources.Upgrade Mongoose to version 6.13.13 or later, which fixes isBsonType() to reject objects where _bsontype is an own property (using Object.prototype.hasOwnProperty.call(obj, '_bsontype')), ensuring only legitimate BSON prototype-based values pass the cast (Patch Commit). As an interim workaround, validate that all request-derived values passed to ObjectId or String query/write fields are primitive types (string or number); use mongoose.isValidObjectId() (not mongoose.isObjectIdOrHexString(), which is also affected) to validate ObjectId inputs before passing them to Mongoose. Do not rely on sanitizeFilter, express-mongo-sanitize, or mongo-sanitize as mitigations, as the advisory explicitly states these do not block this attack (Github Advisory).
The vulnerability was discovered and reported by researcher Michael-JRead and fixed by Mongoose maintainer vkarpov15, who published the security advisory on November 23, 2026. The official CVSS score of 0.0 (Low) has drawn attention given the described impact — cross-request document access and sensitive data disclosure — which Feedly's threat intelligence categorizes as HIGH severity, reflecting a discrepancy between the formal score and practical risk. No significant broader media coverage or notable public social media discussion has been identified at this time (Github Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."