Skip to main content

CVE-2024-53900 — Vulnerability in mongoose — CVE Details

HIGH

Mongoose search injection vulnerability

Published December 2, 2024Updated February 5, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (2.65%). Schedule for your next planned update.

Does your project use an affected mongoose version?

Paste your package-lock.json to check it for CVE-2024-53900 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my package-lock.json

Summary

Mongoose versions prior to 8.8.3, 7.8.3, 6.13.5, and 5.13.23 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.

Advisory Timeline

  • First published December 2, 2024 (725 days ago).
  • Last revised February 5, 2026 — 429 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

npm
Update mongoose to 7.8.3 or later
npm install mongoose@7.8.3
npm
Update mongoose to 6.13.5 or later
npm install mongoose@6.13.5
npm
Update mongoose to 5.13.23 or later
npm install mongoose@5.13.23
npm
Update mongoose to 8.8.3 or later
npm install mongoose@8.8.3

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (4)

Affects 1 ecosystem: npm (1).

PackageFixed In
mongoose npm · Affected: All versions7.8.3
mongoose npm · Affected: All versions6.13.5
mongoose npm · Affected: All versions5.13.23
mongoose npm · Affected: All versions8.8.3

Vulnerability Classification

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

CVSS Score Breakdown

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

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

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

Frequently Asked Questions

What is CVE-2024-53900?
Mongoose search injection vulnerability. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2024-53900?
CVE-2024-53900 affects mongoose. It has a 2.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-53900 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
2.65%
EPSS percentile: 86.4

This places it in the top quartile of EPSS-scored vulnerabilities — 86.4% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.

Also Known As

GHSA-m7xq-9374-9rvx
BIT-mongoose-2024-53900

Related CVEs

  • CVE-2023-3696
    CRITICAL

    Mongoose Prototype Pollution vulnerability

  • CVE-2026-125120
    CRITICAL

    Mongoose: sanitizeFilter not applied on countDocuments

  • CVE-2025-23061
    CRITICAL

    Mongoose search injection vulnerability

  • CVE-2026-83816
    HIGH

    CodeWhale: exec_shell parallel-readonly classifier auto-approves fd/rg/git grep exec flags enabling silent RCE

  • CVE-2026-125117
    HIGH

    Mongoose walks into inherited properties when hydrating, setting, and merging, allowing overwrites of built-in functions (denial of service) and shared schema state

  • CVE-2026-83817
    HIGH

    CodeWhale: Automation auto_approve defaults to true, bypassing the task-path hardening fix for silent recurring agent execution

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my package-lock.json