Security Digest · Vulnerability record

CVE-2025-23061: Mongoose search injection vulnerability

Mongoose before 8.9.5 can improperly use a nested $where filter with a populate() match, leading to search injection.

CVSS 9.0 Critical EPSS 7.3% · p94

Should you act?

Critical and remotely reachable

No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
  • EPSS 7.3%, percentile 94: FIRST’s model estimates a 7.3% chance of exploitation activity in the next 30 days, higher than 94% of all scored CVEs (elevated). EPSS is a probability, not a verdict.
  • Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
  • Only applies if your dependency tree includes mongoose (npm) >= 8.0.0-rc0, < 8.9.5, fixed in 8.9.5; mongoose (npm) >= 7.0.0-rc0, < 7.8.4, fixed in 7.8.4; mongoose (npm) < 6.13.6, fixed in 6.13.6. Check your lockfile, including transitive dependencies.

What it is

Mongoose before 8.9.5 can improperly use a nested $where filter with a populate() match, leading to search injection. NOTE: this issue exists because of an incomplete fix for CVE-2024-53900.

From the GitHub advisory

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.

Weakness type: CWE-94.

Product: mongoose (npm) · Assigned by: mitre · Published: 2025-01-15

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
npmmongoose>= 8.0.0-rc0, < 8.9.58.9.5
npmmongoose>= 7.0.0-rc0, < 7.8.47.8.4
npmmongoose< 6.13.66.13.6
VendorProductAffected versions (per CVE record)
mongoosejsMongoose6.0.0 < 6.13.6, 7.0.0 < 7.8.4, 8.0.0 < 8.9.5

Severity scores

Scored byCVSSScoreVector
mitre3.19 CriticalCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
GitHub3.19.0 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
  • Attack vector: network (remotely reachable)
  • Attack complexity: high (needs special conditions)
  • Privileges required: none (no login)
  • User interaction: none
  • Scope: changed (can affect other components)

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation none, automatable no, technical impact total.
  • FIRST EPSS (model of 2026-10-21): 7.28% probability of exploitation activity in the next 30 days; percentile 94.

Timeline

  • — CVE record last updated
  • — CVE record published by mitre
  • — GitHub-reviewed advisory GHSA-vg7j-7cwx-8wgw published (critical)

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vulnerability records

  1. GitHub Advisory GHSA-vg7j-7cwx-8wgw github.com
  2. CVE.org record CVE-2025-23061 cve.org
  3. NVD entry CVE-2025-23061 nvd.nist.gov

Other references from the CVE record and advisory

  1. npmjs.com npmjs.com
  2. github.com github.com
  3. github.com github.com
  4. github.com github.com
  5. github.com github.com
  6. github.com github.com
  7. github.com github.com
  8. github.com github.com
  9. github.com github.com
  10. github.com github.com

Critical npm advisories · Today’s Security Digest