Mongoose is a widely used npm package. As of 2026-05-24, there are 8 known vulnerabilities in the OSV database. The latest stable version is 9.6.2. Developers should audit their dependency trees and update to patched versions.
Package Overview
Known Vulnerabilities (8)
| ID | Severity | Score | Affected Versions | Fixed In | Description |
|---|---|---|---|---|---|
| CVE-2019-17426 | CRITICAL | 9.5 | 5.0.0 to 5.7.5; 0 to 4.13.21 | 5.7.5 | Improper Input Validation in Automattic Mongoose |
| CVE-2023-3696 | CRITICAL | 9.5 | 7.0.0 to 7.3.3; 6.0.0 to 6.11.3; 0 to 5.13.20 | 7.3.3 | Mongoose Prototype Pollution vulnerability |
| CVE-2022-24304 | CRITICAL | 9.5 | 6.0.0 to 6.4.6; 0 to 5.13.15 | 6.4.6 | Mongoose Vulnerable to Prototype Pollution in Schema Object |
| CVE-2025-23061 | CRITICAL | 9.5 | 8.0.0-rc0 to 8.9.5; 7.0.0-rc0 to 7.8.4; 0 to 6.13.6 | 8.9.5 | Mongoose search injection vulnerability |
| CVE-2022-2564 | HIGH | 7.5 | 6.0.0 to 6.4.6; 0 to 5.13.15 | 6.4.6 | automattic/mongoose vulnerable to Prototype pollution via Schema.path |
| CVE-2024-53900 | HIGH | 7.5 | 8.0.0-rc0 to 8.8.3; 7.0.0-rc0 to 7.8.3; 6.0.0-rc0 to 6.13.5; 3.6.0-rc0 to 5.13.23 | 8.8.3 | Mongoose search injection vulnerability |
| CVE-2026-42334 | HIGH | 7.5 | 0 to 6.13.9; 7.0.0 to 7.8.9; 8.0.0 to 8.22.1; 9.0.0 to 9.1.6 | 6.13.9 | Mongoose's Improper Sanitization of $nor in sanitizeFilter May Allow NoSQL Injection |
| GHSA-r5xw-q988-826m | MODERATE | 5.0 | 3.5.5 to 3.8.39; 4.0.0 to 4.3.6 | 3.8.39 | Remote Memory Exposure in mongoose |
Security Recommendations
- Pin Mongoose to the latest stable version (9.6.2) in your dependency manifest
- Enable automated dependency updates with Dependabot or Renovate
- Run regular vulnerability scans using
npm audit - Review your lock file (.package-lock.json) after every update
- Monitor the OSV database and NIST NVD for new advisories
FAQ
Is Mongoose safe to use?
Mongoose is actively maintained and widely used. As of 2026-05-24, there are 8 known vulnerabilities listed in the OSV database. Most have patches available. Keeping your dependencies updated and running regular security audits significantly reduces risk.
What vulnerabilities does Mongoose have?
The OSV database currently lists 8 vulnerabilities for Mongoose. These range in severity and are detailed in the vulnerability table above. Check the linked advisories for full technical details and remediation guidance.
How do I update Mongoose to fix vulnerabilities?
Run npm update mongoose or npm install mongoose@latest to get the newest version. Use npm audit to identify vulnerable dependencies in your project. Enable automated updates with Dependabot or Renovate to stay current.
Using AI-Generated Code with Mongoose?
Our vibe coding security audit checks for misconfigurations, exposed secrets and vulnerable dependencies in AI-generated codebases. If your project uses Mongoose, we can verify it is locked to a safe version and properly configured.
Get a Vibe Coding Security Audit