CVE Catalog

CVE-2026-125119

HighCVSS 7.5
Published: Translated: NVD NIST

Summary

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.

Risk Assessment

An attacker may bypass authentication by matching an account record using a query operator instead of the correct password. The risk affects applications relying on sanitizeFilter set via connect() or createConnection().

Recommendation

Upgrade Mongoose to version 6.13.12, 7.8.13, 8.24.7, or 9.11.4 (or later). Until patched, use global configuration via mongoose.set('sanitizeFilter') or per-query Model.find().sanitizeFilter().

Other vulnerabilities in Mongoose

See all
Original NVD description (English source)

Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. From 6.0.0 until 6.13.12, 7.8.13, 8.24.7, and 9.11.4, 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 through mongoose.connect() or createConnection() and passes an attacker-controlled object into a query filter therefore receives a connection that reports 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, while global configuration through mongoose.set('sanitizeFilter') and per-query Model.find().sanitizeFilter() remain unaffected. This issue is fixed in versions 6.13.12, 7.8.13, 8.24.7, and 9.11.4.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS