CVE-2025-23061
JSON

9.0critical

Mongoose search injection vulnerability

Severity
9.0critical CVSS:3.1 by mitre
Exploit likelihood
7.24% (higher than 94% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-vg7j-7cwx-8wgwBIT-MONGOOSE-2025-23061

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.

Affected

Product or packageVersionsReported by
mongoosejs Mongoosefrom 6.0.0 before 6.13.6, from 7.0.0 before 7.8.4, from 8.0.0 before 8.9.5, before 6.13.6CVE List, NVD
mongoose (npm)from 8.0.0-rc0 before 8.9.5, from 7.0.0-rc0 before 7.8.4, before 6.13.6GitHub Advisory Database
mongoose (Bitnami)from 6.0.0 before 6.13.6, from 7.0.0 before 7.8.4, from 8.0.0 before 8.9.5Bitnami Vulnerability Database

All scores

mitre9.0critical CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
GitHub9.0critical CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Bitnami Vulnerability Databasecritical rating

Classification

CWE-94

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database

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.

NVD (es)

Mongoose anterior a la versión 8.9.5 puede usar incorrectamente un filtro $where anidado con una coincidencia populate(), lo que provoca una inyección de búsqueda. NOTA: este problema existe debido a una corrección incompleta de CVE-2024-53900.

References

https://www.npmjs.com/package/mongoose?activeTab=versionsproduct, web
https://github.com/Automattic/mongoose/blob/master/CHANGELOG.mdarticle, release-notes, web
https://github.com/Automattic/mongoose/releases/tag/8.9.5article, release-notes, web
https://github.com/Automattic/mongoose/commit/64a9f9706f2428c49e0cfb8e223065acc645f7bcfix, patch, web
https://nvd.nist.gov/vuln/detail/CVE-2025-23061advisory, web
https://github.com/Automattic/mongoosepackage
https://github.com/Automattic/mongoose/compare/6.13.5...6.13.6web
https://github.com/Automattic/mongoose/compare/7.8.3...7.8.4web
https://github.com/Automattic/mongoose/compare/8.9.4...8.9.5web
https://github.com/Automattic/mongoose/releases/tag/6.13.6web
https://github.com/Automattic/mongoose/releases/tag/7.8.4web
https://github.com/advisories/GHSA-m7xq-9374-9rvxadvisory

Sources

SourceRecordLicence
CVE ListCVE-2025-23061 changed 2025-01-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-vg7j-7cwx-8wgw changed 2025-10-03CC-BY-4.0
NVDCVE-2025-23061 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-MONGOOSE-2025-23061 changed 2026-09-10Apache-2.0