CVE-2025-23061
JavaScript vulnerability analysis and mitigation

Overview

A critical vulnerability (CVE-2025-23061) was discovered in Mongoose before version 8.9.5, affecting its populate() match functionality. The vulnerability allows improper use of a nested $where filter with a populate() match, leading to search injection. This issue exists as a result of an incomplete fix for a previous vulnerability (CVE-2024-53900). The vulnerability was disclosed on January 15, 2025, and affects all versions of Mongoose prior to 8.9.5 (NVD, Red Hat).

Technical details

The vulnerability has been assigned a CVSS v3.1 base score of 9.0 (CRITICAL) with the vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H. The issue is classified as CWE-94 (Improper Control of Generation of Code - 'Code Injection'). The vulnerability specifically involves the improper handling of nested $where filters when used in conjunction with the populate() match functionality, which could allow attackers to perform search injection attacks (NVD, Security Online).

Impact

With approximately 2.7 million weekly downloads, this vulnerability poses a significant risk to applications using affected Mongoose versions. The critical CVSS score of 9.0 indicates that successful exploitation could lead to severe consequences, potentially allowing attackers to inject malicious search queries and gain unauthorized access to sensitive data (Security Online).

Mitigation and workarounds

Users should immediately upgrade to Mongoose version 8.9.5 or later, which contains the fix for this vulnerability. The fix involves implementing proper validation and restrictions on nested $where filters in populate() match operations (Mongoose Changelog, Mongoose Release).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management