Loading...
Skip to main content

CVE-2025-23061 — Vulnerability in mongoose — CVE Details

CRITICAL

Mongoose search injection vulnerability

Published January 15, 2025Updated October 3, 2025Source: osv

Summary

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.

Advisory Timeline

  • First published January 15, 2025 (635 days ago).
  • Last revised October 3, 2025 — 261 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

npm
Update mongoose to 6.13.6 or later
npm install mongoose@6.13.6
npm
Update mongoose to 7.8.4 or later
npm install mongoose@7.8.4
npm
Update mongoose to 8.9.5 or later
npm install mongoose@8.9.5

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (3)

Affects 1 ecosystem: npm (1).

PackageEcosystemAffectedFixed In
mongoose
npm
All versions6.13.6
mongoose
npm
All versions7.8.4
mongoose
npm
All versions8.9.5

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.0 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2025-23061?
Mongoose search injection vulnerability This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.0/10).
How do I check if my project is affected by CVE-2025-23061?
CVE-2025-23061 affects mongoose. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-23061 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.0

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-vg7j-7cwx-8wgw
BIT-mongoose-2025-23061

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies