CVE-2025-23061: mongoosejs Mongoose · Code Injection
Affects mongoosejs MongooseSource CVE Database V5
Mentioned vulnerabilities
Not known to be exploited · public detection template (Nuclei) · CVSS 9.0 Critical : upgrade to 8.9.5 as a priority.
Data as of 26 Oct 2026, 10:12 UTC
- EPSS
- 7.2% chance of exploitation in 30 days – higher than 94% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 8.9.5
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 25 Sep 2025
Detectable: evidence found.
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade mongoosejs Mongoose to 8.9.5.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
npmmongoosepkg:npm/mongooseOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
To mitigate CVE-2025-23061, organizations should immediately upgrade Mongoose to version 8.9.5 or later, where the vulnerability is fixed. If upgrading is not immediately feasible, implement strict input validation and sanitization on all user-supplied query parameters, especially those involving $where and populate() match filters. Disable or restrict the use of the $where operator in MongoDB queries if possible, as it inherently allows JavaScript execution. Employ application-layer firewalls or query filtering mechanisms to detect and block suspicious query patterns indicative of injection attempts. Conduct thorough code reviews and static analysis focusing on database query construction to identify unsafe patterns. Monitor application logs and database activity for anomalous queries or errors related to $where usage. Additionally, isolate database servers from direct internet exposure and enforce the principle of least privilege on database access credentials. Finally, maintain an up-to-date inventory of Mongoose versions in use and integrate vulnerability scanning into the CI/CD pipeline to catch vulnerable dependencies early.
Description
Mongoose before 8.9.5 can improperly use a nested $where filter with a populate() match, leading to search injection. NOTE: this issue exists because of an incomplete fix for CVE-2024-53900.
References
- npmjs.com/package/mongoose?activeTab=versions (opens in a new tab)
- github.com/Automattic/mongoose/blob/master/CHANGELOG.md (opens in a new tab)
- github.com/Automattic/mongoose/releases/tag/8.9.5 (opens in a new tab)
- github.com/Automattic/mongoose/commit/64a9f9706f2428c49e0cfb8e223065acc645f7bc (opens in a new tab)