Database JavaScript execution via nested $where filter
Published Jan 15, 2025 · Updated Jan 15, 2025
Search injection in Mongoose before 6.13.6, 7.0.0 through 7.8.3, or 8.0.0 through 8.9.4 allows remote attackers to run database JavaScript. The populate() match guard checks only top-level $where keys, allowing a nested $where under $or or $and to reach MongoDB's JavaScript evaluator. Exploitation requires an application to pass attacker-controlled match data to populate(); successful queries can read or manipulate database data.
Summary
What happened
Search injection in Mongoose before 6.13.6, 7.0.0 through 7.8.3, or 8.0.0 through 8.9.4 allows remote attackers to run database JavaScript. The populate() match guard checks only top-level $where keys, allowing a nested $where under $or or $and to reach MongoDB's JavaScript evaluator. Exploitation requires an application to pass attacker-controlled match data to populate(); successful queries can read or manipulate database data.
The record
- CVE
- CVE-2025-23061
- Published
- Jan 15, 2025
- Updated
- Jan 15, 2025
- Vendor
- Automattic
- Product
- Mongoose
- Classifications
- CWE-94, T1190
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Jan 15, 2025CVE publishedPublication date reported by the CVE source.
- Jan 15, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=6.0.0 <6.13.6
- Affected versionversion=7.0.0 <7.8.4
- Affected versionversion=8.0.0 <8.9.5
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- open-flaw CVE-2025-23061 proof of conceptproof of concept · unverified
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo