Mongoose search injection vulnerability
Mongoose versions prior to 8.8.3, 7.8.3, 6.13.5, and 5.13.23 are vulnerable to improper use of the $where operator. This vulnerability arises from the ability of the $where clause to execute arbitrary JavaScript code in MongoDB queries, potentially leading to code injection attacks and unauthorized access or manipulation of database data.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | mongoose | >= 8.0.0-rc0, < 8.8.3, >= 7.0.0-rc0, < 7.8.3, >= 6.0.0-rc0, < 6.13.5, >= 3.6.0-rc0, < 5.13.23 | 8.8.3, 7.8.3, 6.13.5, 5.13.23 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-53900
- https://github.com/github/advisory-database/pull/6769
- https://github.com/github/advisory-database/pull/6776
- https://github.com/Automattic/mongoose/commit/33679bcf8ca43d74e3e8ecd4cc224826772d805b
- https://github.com/Automattic/mongoose/commit/bbb6fa7ecb44bbaf5bea955d886378a1247bce0b
- https://github.com/Automattic/mongoose/commit/c9e86bff7eef477da75a29af62a06d41a835a156
- https://github.com/Automattic/mongoose
- https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md
- https://github.com/Automattic/mongoose/compare/6.13.4...6.13.5
- https://github.com/Automattic/mongoose/compare/7.8.2...7.8.3
- https://github.com/Automattic/mongoose/compare/8.8.2...8.8.3
- https://github.com/Automattic/mongoose/releases
- https://www.npmjs.com/package/mongoose?activeTab=versions
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-89- Platform
- npm
- Package
mongoose- Disclosed
- 02.12.2024
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-m7xq-9374-9rvx - CC BY 4.0
Vulnerability history: mongoose
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 9
- First → latest
- 10.2019 07.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 4
- High 3
- Medium 2
Disclosures per year
- 2019: 1
- 2020: 1
- 2021: 0
- 2022: 2
- 2023: 1
- 2024: 1
- 2025: 1
- 2026: 2
-
Mongoose search injection vulnerability this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.