CVE-2025-23061
Mongoose search injection vulnerability
9.0
CRITICAL
CVSS 3.1
EPSS 55.3%
Description
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.
How to fix CVE-2025-23061
To remediate CVE-2025-23061, upgrade the affected package to a fixed version below.
- —upgrade to 6.13.6 or later
- —upgrade to 8.9.5 or later
Is CVE-2025-23061 being exploited?
Likely — EPSS is 55.3%, placing CVE-2025-23061 in the top tier of vulnerabilities by exploitation probability. Prioritise patching.
Affected packages (2)
- >= 6.0.0, < 6.13.6, >= 7.0.0, < 7.8.4, >= 8.0.0, < 8.9.5
- >= 8.0.0-rc0, < 8.9.5
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 3.1 | CRITICAL9.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H |