CVE-2025-51495
HighCVSS 7.5Exploitation Probability (EPSS)
Low risk37th percentile - higher than 37% of all known CVEs
Summary
An integer overflow vulnerability exists in the WebSocket component of Mongoose 7.5 thru 7.17. By sending a specially crafted WebSocket request, an attacker can cause the application to crash. If downstream vendors integrate this component improperly, the issue may lead to a buffer overflow.
Risk Assessment
An attacker can remotely cause denial of service and, with improper integration, potentially exploit a buffer overflow for further attacks. The risk affects applications using the vulnerable Mongoose version.
Recommendation
Update Mongoose to a version later than 7.17 or apply the vendor fix. Also verify how the WebSocket component is integrated in dependent applications.
Other vulnerabilities in Mongoose
See all- CVE-2026-125119High
Mongoose stores the connection-level sanitizeFilter option in Connection.config, but Query.prototype._castConditions() and query casting check other option locations and do not read that configuration. An application that enables sanitizeFilter via mongoose.connect() or createConnection() and passes an attacker-controlled object into a query filter receives a connection reporting the defense as enabled while query selector objects remain unsanitized. A crafted password value using a query operator can match an account record without the expected literal password.
- CVE-2026-125118Medium
Mongoose prior to 6.13.12, 7.8.13, 8.24.7, and 9.11.4 allows Schema.prototype.virtual() to build nested virtual paths without the special-property validation used by Schema.path() and Schema.add(). An attacker able to influence virtual field names can supply path segments such as __proto__, constructor, or prototype, causing prototype pollution of Object.prototype or Function.prototype. This can spoof inherited property checks such as authorization flags.
- CVE-2026-125117High
Mongoose can descend into inherited properties while loading documents in init(), setting dotted paths in $__set, and merging update documents in utils.mergeClone. Attacker-controlled keys such as toString or valueOf can cause writes into shared built-in functions instead of an own property. A crafted document, Mixed path, non-strict document or subdocument, findOneAndReplace() replacement, chained update, or Query.prototype.merge() source can overwrite Object.prototype.toString.call, causing later queries on unrelated models to fail until process restart. Additionally, when an attacker controls the dotted path passed to doc.set() for a subdocument with strict: false, descent through $__set can reach $__schema and alter shared validators or schema options.
- CVE-2026-125116Medium
Mongoose prior to 6.13.12, 7.8.13, 8.24.7, and 9.11.4 uses attacker-controlled discriminator key values, including the default __t field, to index plain-object registries such as Model.discriminators and schema.discriminators without requiring an own property. Values such as constructor, toString, or hasOwnProperty can resolve to inherited built-in functions, causing type confusion in model construction, document creation, hydration, query and update casting, embedded discriminators, and populate operations. In the bulkWrite() insertOne path with skipValidation enabled, a constructor value can cause a raw input object to be stored without schema casting, and a stored poisoned document can make every query that hydrates it fail until removed.
- CVE-2026-125120Critical
Mongoose countDocuments() does not apply the configured sanitizeFilter query selector injection defense. An application that enables sanitizeFilter and passes attacker-controlled filter values to countDocuments() can process query operator objects as operators rather than literal values, causing the count to include documents that should not match and potentially undermining authorization or application logic based on that count.
- CVE-2026-73257Critical
A vulnerability in Mongoose before version 7.22 allows a remote unauthenticated attacker to send an HTTP request with both Content-Length and Transfer-Encoding: chunked. The cl_count and te_count checks accept both headers and prioritize chunked encoding, leading to CL.TE desynchronization and request injection in another user's context.
- CVE-2026-73256Critical
A vulnerability in Mongoose before version 7.22 allows a remote unauthenticated attacker to exploit an HTTP/1.0 reverse-proxy deployment by sending a request with Transfer-Encoding: chunked and conflicting framing. The http_cb() function tests hm.proto.len with an impossible greater-than-eight condition, so is_http_1_0 is never set, and Mongoose processes chunked encoding that an HTTP/1.0 proxy can ignore.
- CVE-2026-73253Critical
A vulnerability in Mongoose before version 7.22 allows an on-path network attacker with a wildcard certificate for a parent domain to impersonate deeper subdomains to a client using the built-in TLS stack. The mg_tls_verify_cert_san() and mg_tls_verify_cert_cn() functions call mg_match(), whose wildcard can cross DNS label boundaries, so a pattern like *.example.com can match foo.bar.example.com.
- CVE-2026-73251Critical
A vulnerability in Mongoose before version 7.23 allows a network attacker to impersonate a TLS server to a Mongoose client configured with a multi-certificate CA bundle. The mg_tls_init() function stores the bundle in tls->ca_bundle_der while tls->ca_der.len remains zero, and mg_tls_recv_cert() uses tls_bundle_find() to accept a Common Name match without verifying the certificate signature.
- CVE-2026-115473Medium
In Mongoose prior to 7.22, mg_path_is_sane in src/util.c read path.buf[1] without first requiring path.len to be at least two and read s[2] when only two bytes remained. Unauthenticated remote requests to mg_http_upload or mg_http_serve_dir with affected short path shapes could trigger one-byte heap out-of-bounds reads.
Original NVD description (English source)
An integer overflow vulnerability exists in the WebSocket component of Mongoose 7.5 thru 7.17. By sending a specially crafted WebSocket request, an attacker can cause the application to crash. If downstream vendors integrate this component improperly, the issue may lead to a buffer overflow.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

