{"id":"GHSA-vg7j-7cwx-8wgw","summary":"Mongoose search injection vulnerability","details":"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.\n\nNOTE: this issue exists because of an incomplete fix for CVE-2024-53900.","aliases":["BIT-mongoose-2025-23061","CVE-2025-23061"],"modified":"2025-10-03T15:40:22Z","published":"2025-01-15T06:30:49Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2025-01-16T14:02:22Z","nvd_published_at":"2025-01-15T05:15:10Z","cwe_ids":["CWE-94"],"severity":"CRITICAL"},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-23061"},{"type":"WEB","url":"https://github.com/Automattic/mongoose/commit/64a9f9706f2428c49e0cfb8e223065acc645f7bc"},{"type":"PACKAGE","url":"https://github.com/Automattic/mongoose"},{"type":"WEB","url":"https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md"},{"type":"WEB","url":"https://github.com/Automattic/mongoose/compare/6.13.5...6.13.6"},{"type":"WEB","url":"https://github.com/Automattic/mongoose/compare/7.8.3...7.8.4"},{"type":"WEB","url":"https://github.com/Automattic/mongoose/compare/8.9.4...8.9.5"},{"type":"WEB","url":"https://github.com/Automattic/mongoose/releases/tag/6.13.6"},{"type":"WEB","url":"https://github.com/Automattic/mongoose/releases/tag/7.8.4"},{"type":"WEB","url":"https://github.com/Automattic/mongoose/releases/tag/8.9.5"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-m7xq-9374-9rvx"},{"type":"WEB","url":"https://www.npmjs.com/package/mongoose?activeTab=versions"}],"affected":[{"package":{"name":"mongoose","ecosystem":"npm","purl":"pkg:npm/mongoose"},"ranges":[{"type":"SEMVER","events":[{"introduced":"8.0.0-rc0"},{"fixed":"8.9.5"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/01/GHSA-vg7j-7cwx-8wgw/GHSA-vg7j-7cwx-8wgw.json"}},{"package":{"name":"mongoose","ecosystem":"npm","purl":"pkg:npm/mongoose"},"ranges":[{"type":"SEMVER","events":[{"introduced":"7.0.0-rc0"},{"fixed":"7.8.4"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/01/GHSA-vg7j-7cwx-8wgw/GHSA-vg7j-7cwx-8wgw.json"}},{"package":{"name":"mongoose","ecosystem":"npm","purl":"pkg:npm/mongoose"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"6.13.6"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/01/GHSA-vg7j-7cwx-8wgw/GHSA-vg7j-7cwx-8wgw.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H"}]}