{"id":"CVE-2025-23061","published":"2025-01-15T00:00:00Z","modified":"2025-01-15T15:11:21Z","title":"Mongoose before 8.9.5 can improperly use a nested $where filter with a populate() match, leading to search injection","vendor":"mongoosejs","product":"Mongoose","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.04348,"percentile":0.91992,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://www.npmjs.com/package/mongoose?activeTab=versions","tags":[]},{"url":"https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md","tags":[]},{"url":"https://github.com/Automattic/mongoose/releases/tag/8.9.5","tags":[]},{"url":"https://github.com/Automattic/mongoose/commit/64a9f9706f2428c49e0cfb8e223065acc645f7bc","tags":[]}],"priority":{"score":29.7,"factors":[{"name":"EPSS percentile","points":18.4},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":6.3}]},"exploitSources":{"pocGithub":{"count":1,"skipped":1,"earliest":"2025-12-11","earliestUrl":"https://github.com/open-flaw/CVE-2025-23061","repos":[{"name":"open-flaw/CVE-2025-23061","url":"https://github.com/open-flaw/CVE-2025-23061","stars":0,"created":"2025-12-11"}]},"nuclei":[{"id":"CVE-2025-23061","name":"Mongoose - NoSQL Injection","severity":"critical","path":"http/cves/2025/CVE-2025-23061.yaml","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-23061.yaml"}],"first":{"date":"2025-12-11","source":"PoC-in-GitHub","url":"https://github.com/open-flaw/CVE-2025-23061"},"provenance":"source"},"vendorSlug":"mongoosejs","affectedVersions":[{"vendor":"mongoosejs","product":"Mongoose","versions":[">= 6.0.0, < 6.13.6",">= 7.0.0, < 7.8.4",">= 8.0.0, < 8.9.5"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-01-15T15:10:29.550980Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"mongoose","vulnerableRanges":[">=8.0.0-rc0, <8.9.5",">=7.0.0-rc0, <7.8.4","<6.13.6"],"patched":["8.9.5","7.8.4","6.13.6"],"from":["GHSA-vg7j-7cwx-8wgw"],"provenance":"source"}],"summary":{"text":"Mongoose versions before 8.9.5 contain a flaw in how a nested $where filter is handled alongside a populate() match, which improperly generates query logic. An attacker with network access and no authentication, able to influence the query input and needing a configuration that uses this filter pattern, can inject search conditions that alter how data is retrieved.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T00:18:44Z"},"euvd":{"id":"EUVD-2025-0106","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-mongoosejs-mongoose-cve-2024-53900","parents":[{"from":"CVE-2024-53900","to":"CVE-2025-23061","relation":"incomplete-fix","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"NOTE: this issue exists because of an incomplete fix for CVE-2024-53900.","from":"CVE.org","in":"CVE-2025-23061"},{"kind":"osv-related","provenance":"source","id":"GHSA-vg7j-7cwx-8wgw","via":"reference","url":"https://github.com/advisories/GHSA-m7xq-9374-9rvx"},{"kind":"version-step","provenance":"source","package":"npm:mongoose","fromFixed":"6.13.5","toFixed":"6.13.6","daysApart":44},{"kind":"version-step","provenance":"source","package":"npm:mongoose","fromFixed":"7.8.3","toFixed":"7.8.4","daysApart":44},{"kind":"same-code","provenance":"machine","files":["lib/helpers/populate/getModelsMapForPopulate.js"],"commits":["https://github.com/Automattic/mongoose/commit/c9e86bff7eef477da75a29af62a06d41a835a156","https://github.com/Automattic/mongoose/commit/33679bcf8ca43d74e3e8ecd4cc224826772d805b","https://github.com/Automattic/mongoose/commit/64a9f9706f2428c49e0cfb8e223065acc645f7bc"],"basis":"shared function","functions":["_virtualPopulate","getModelsMapForPopulate"]}]}],"packageHistory":[{"cve":"CVE-2022-2564","published":"2022-07-28","fixed":"6.4.6","kev":false},{"cve":"CVE-2023-3696","published":"2023-07-17","fixed":"7.3.3","kev":false},{"cve":"CVE-2024-53900","published":"2024-12-02","fixed":"8.8.3","kev":false},{"cve":"CVE-2025-23061","published":"2025-01-15","fixed":"8.9.5","kev":false},{"cve":"CVE-2026-42334","published":"2026-05-14","fixed":"9.1.6","kev":false,"link":{"from":"CVE-2025-23061","to":"CVE-2026-42334","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:mongoose","fromFixed":"6.13.6","toFixed":"6.13.9","daysApart":484},{"kind":"version-step","provenance":"source","package":"npm:mongoose","fromFixed":"7.8.4","toFixed":"7.8.9","daysApart":484}]}},{"cve":"CVE-2026-73562","published":"2026-08-13","fixed":"9.7.2","kev":false},{"cve":"CVE-2026-125120","published":"2026-11-09","fixed":"9.9.2","kev":false}],"package":"npm:mongoose"}}