Patchfirst
CVE-2024-53900 Public exploit Critical · 9.1 EPSS 4.0%

Mongoose before 8.8.3 can improperly use $where in match, leading to search injection.

Fix:upgrade mongoose to 8.24.3 or later also fixes CVE-2026-125120 Details ↓

Summary

The flaw is in Mongoose, the MongoDB object modeling library, before version 8.8.3, where the $where operator can be improperly used within match. An attacker who can supply input to a query built this way can inject search logic, a weakness categorised as improper neutralisation of special elements in a query command.

Heading is the official description · CVE.org
Breakdown
69.5 / 100
Exploited
Yes, in VulnCheck KEV
Reports
0
Tactics
0/15

First seen exploited 12 months after disclosure. Public exploit code (PoC-in-GitHub) appeared 4 months after disclosure.

  1. Disclosedday 0
  2. Public exploit codePoC-in-GitHub+4 mo
  3. First seen exploitedVulnCheck KEV evidence+12 mo

A fix was bypassed or incomplete once over 6 weeks. The latest fix listed for mongoose is 9.7.2.

Linked vulnerabilitiesLinked by evidence that a fix failed or the same code was patched again. Oldest first.

  1. This CVECVE-2024-53900Mongoose before 8.8.3 can improperly use $where in match…2 Dec 2024
  2. incomplete fixHigh

    Why these are linked:

    • Stated in the CVE textNOTE: this issue exists because of an incomplete fix for CVE-2024-53900.
    • Linked in OSV/GitHub advisoryGHSA-vg7j-7cwx-8wgw
    • Fixed one release later6.13.5 → 6.13.6 (mongoose)
    • Fixed one release later7.8.3 → 7.8.4 (mongoose)
    • Same code patched: getModelsMapForPopulate.js (machine-matched)Functions: _virtualPopulate, getModelsMapForPopulatecommit c9e86bfcommit 33679bccommit 64a9f97
    CVE-2025-23061Mongoose before 8.9.5 can improperly use a nested $where filter…15 Jan 2025

Fixes in mongoosenpm package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.

  1. 5.7.5CVE-2019-1742610 Oct 2019
  2. 6.4.6CVE-2022-256428 Jul 2022
  3. 7.3.3CVE-2023-369617 Jul 2023
  4. 8.8.3CVE-2024-539002 Dec 2024
  5. 8.9.5CVE-2025-2306115 Jan 2025
  6. 9.1.6CVE-2026-4233414 May 2026
  7. 9.7.2CVE-2026-7356213 Aug 2026Latest listed

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: mongoose.

Upgrade to 8.24.3 or later

Fixes this CVE and 1 other known vulnerability in this package (CVE-2026-125120).

npmnpm install mongoose@8.24.3

First fixed in 8.8.3 for CVE-2024-53900.

Affected versions, by release line

If you runUpgrade to
8.0.0-rc0 up to 8.8.38.24.3first fix for this CVE: 8.8.3
7.0.0-rc0 up to 7.8.37.8.12first fix for this CVE: 7.8.3
6.0.0-rc0 up to 6.13.56.13.11first fix for this CVE: 6.13.5
3.6.0-rc0 up to 5.13.23

Still affected on this line by CVE-2026-125120 (fixed in 6.13.11, a newer line).

5.13.23

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

References

5 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close