Skip to main content
VulnerabilityPublished

CVE-2025-23061: mongoosejs Mongoose · Code Injection

Affects mongoosejs MongooseSource CVE Database V5

0

Mentioned vulnerabilities

Not known to be exploited · public detection template (Nuclei) · CVSS 9.0 Critical : upgrade to 8.9.5 as a priority.

Data as of 26 Oct 2026, 10:12 UTC

CVSS 3.1 base score
9.0Critical
How severe the flaw is on the 0–10 CVSS scale.
EPSS
7.2% chance of exploitation in 30 days – higher than 94% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 8.9.5
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 25 Sep 2025

  2. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  3. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  4. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.

What to do

Upgrade mongoosejs Mongoose to 8.9.5.

Affected software

ProductAffectedFixed in
npmmongoosepkg:npm/mongooseOther threatsAffected
  • <8.9.5
Fixed in
  • 8.9.5

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

To mitigate CVE-2025-23061, organizations should immediately upgrade Mongoose to version 8.9.5 or later, where the vulnerability is fixed. If upgrading is not immediately feasible, implement strict input validation and sanitization on all user-supplied query parameters, especially those involving $where and populate() match filters. Disable or restrict the use of the $where operator in MongoDB queries if possible, as it inherently allows JavaScript execution. Employ application-layer firewalls or query filtering mechanisms to detect and block suspicious query patterns indicative of injection attempts. Conduct thorough code reviews and static analysis focusing on database query construction to identify unsafe patterns. Monitor application logs and database activity for anomalous queries or errors related to $where usage. Additionally, isolate database servers from direct internet exposure and enforce the principle of least privilege on database access credentials. Finally, maintain an up-to-date inventory of Mongoose versions in use and integrate vulnerability scanning into the CI/CD pipeline to catch vulnerable dependencies early.

Description

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.

References

Community reviews

Loading reviews…