CVE-2025-23061
published 2025-01-15CVE-2025-23061: 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…
PriorityP264critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EXPLOIT
EPSS
7.03%
93.4th percentile
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.
Affected
6 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| cesanta | mongoose | >= 0 < 6.13.6 | 6.13.6 |
| cesanta | mongoose | >= 7.0.0-rc0 < 7.8.4 | 7.8.4 |
| cesanta | mongoose | >= 8.0.0-rc0 < 8.9.5 | 8.9.5 |
| mongoosejs | mongoose | < 6.13.6 | 6.13.6 |
| mongoosejs | mongoose | >= 7.0.0 < 7.8.4 | 7.8.4 |
| mongoosejs | mongoose | >= 8.0.0 < 8.9.5 | 8.9.5 |
Detection & IOCsextracted from sources · hover to see the quote
- →Look for HTTP requests containing nested $where operators inside logical operators (e.g., $and) targeting the populate() match option — a bypass of the CVE-2024-53900 patch. ↗
- →Match HTTP response body for JSON fields 'isAdmin':true, 'title':, and 'username': together with HTTP 200 and Content-Type application/json to confirm successful NoSQL injection via populate() match. ↗
- →Use Shodan query 'title:"Mongoose"' or FOFA query 'title="Mongoose"' to identify potentially exposed Mongoose-backed Node.js endpoints for targeted scanning. ↗
- ·The vulnerability only affects Mongoose versions prior to 8.9.5; the nested $where bypass does not apply to patched versions. ↗
- ·Direct $where injection is already blocked by the prior CVE-2024-53900 fix; only the nested form (e.g., inside $and) constitutes the bypass covered by this CVE. ↗
- ·Exploitation requires high attack complexity (AC:H per CVSS) and is scoped as Changed (S:C), meaning impact can extend beyond the vulnerable component to the MongoDB server itself. ↗
CVSS provenance
nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
ghsa9.1CRITICAL
osv9.1CRITICAL
CVEs like this are exactly what “Exploited This Week” covers.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
Mongoose search injection vulnerability
ghsa·2025-01-15·CVSS 9.1
CVE-2025-23061 [CRITICAL] CWE-94 Mongoose search injection vulnerability
Mongoose search injection vulnerability
Mongoose versions prior to 8.9.5, 7.8.4, and 6.13.6 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.
NOTE: this issue exists because of an incomplete fix for CVE-2024-53900.
OSV
Mongoose search injection vulnerability
osv·2025-01-15·CVSS 9.1
CVE-2025-23061 [CRITICAL] Mongoose search injection vulnerability
Mongoose search injection vulnerability
Mongoose versions prior to 8.9.5, 7.8.4, and 6.13.6 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.
NOTE: this issue exists because of an incomplete fix for CVE-2024-53900.
No detection rules found.
Nuclei
Mongoose - NoSQL Injection
nuclei·CVSS 9.1
CVE-2025-23061 [CRITICAL] Mongoose - NoSQL Injection
Mongoose - NoSQL Injection
NoSQL injection vulnerability in Mongoose < 8.9.5 affecting the populate() function's match option. This vulnerability exists due to an incomplete fix for CVE-2024-53900. While direct $where injection is blocked, attackers can bypass this protection by nesting $where operators within logical operators like $and, allowing execution of arbitrary JavaScript code on MongoDB server, bypassing authentication, and accessing sensitive administrative data.
Template:
id: CVE-2025-23061
info:
name: Mongoose - NoSQL Injection
author: NamhyunKo
severity: critical
description: |
NoSQL injection vulnerability in Mongoose < 8.9.5 affecting the populate() function's match option. This vulnerability exists due to an incomplete fix for CVE-2024-53900. While direct $where inject
No writeups or analysis indexed.
2025-01-15
Published