Security Digest · Vulnerability record
CVE-2025-23061: Mongoose search injection vulnerability
Mongoose before 8.9.5 can improperly use a nested $where filter with a populate() match, leading to search injection.
CVSS 9.0 Critical EPSS 7.3% · p94
Should you act?
Critical and remotely reachable
No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.
- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 7.3%, percentile 94: FIRST’s model estimates a 7.3% chance of exploitation activity in the next 30 days, higher than 94% of all scored CVEs (elevated). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes
mongoose(npm) >= 8.0.0-rc0, < 8.9.5, fixed in 8.9.5;mongoose(npm) >= 7.0.0-rc0, < 7.8.4, fixed in 7.8.4;mongoose(npm) < 6.13.6, fixed in 6.13.6. Check your lockfile, including transitive dependencies.
What it is
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.
From the GitHub advisory
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.
Weakness type: CWE-94.
Product: mongoose (npm) · Assigned by: mitre · Published: 2025-01-15
Affected and fixed versions
| Ecosystem | Package | Vulnerable | First fixed |
|---|---|---|---|
| npm | mongoose | >= 8.0.0-rc0, < 8.9.5 | 8.9.5 |
| npm | mongoose | >= 7.0.0-rc0, < 7.8.4 | 7.8.4 |
| npm | mongoose | < 6.13.6 | 6.13.6 |
| Vendor | Product | Affected versions (per CVE record) |
|---|---|---|
| mongoosejs | Mongoose | 6.0.0 < 6.13.6, 7.0.0 < 7.8.4, 8.0.0 < 8.9.5 |
Severity scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| mitre | 3.1 | 9 Critical | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H |
| GitHub | 3.1 | 9.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H |
- Attack vector: network (remotely reachable)
- Attack complexity: high (needs special conditions)
- Privileges required: none (no login)
- User interaction: none
- Scope: changed (can affect other components)
CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.
Exploitation and urgency
- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none, automatable no, technical impact total.
- FIRST EPSS (model of 2026-10-21): 7.28% probability of exploitation activity in the next 30 days; percentile 94.
Timeline
- — CVE record last updated
- — CVE record published by mitre
- — GitHub-reviewed advisory GHSA-vg7j-7cwx-8wgw published (critical)
Sources and references
Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.
Vulnerability records
- GitHub Advisory GHSA-vg7j-7cwx-8wgw github.com
- CVE.org record CVE-2025-23061 cve.org
- NVD entry CVE-2025-23061 nvd.nist.gov
Other references from the CVE record and advisory
- npmjs.com npmjs.com
- github.com github.com
- github.com github.com
- github.com github.com
- github.com github.com
- github.com github.com
- github.com github.com
- github.com github.com
- github.com github.com
- github.com github.com