Advisory

GHSA-vg7j-7cwx-8wgw

Also known as: BIT-mongoose-2025-23061, CVE-2025-23061

Summary

Mongoose search injection vulnerability

Details

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.

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2025-01-15 06:30 UTC
Modified
2025-10-03 15:40 UTC

Affected packages and fixes

mongoose

npm · All systems

Affected

  • introduced 8.0.0-rc0, fixed 8.9.5 (semver)

Fixed versions

8.9.5

Fix

mongoose

npm · All systems

Affected

  • introduced 7.0.0-rc0, fixed 7.8.4 (semver)

Fixed versions

7.8.4

Fix

mongoose

npm · All systems

Affected

  • introduced 0, fixed 6.13.6 (semver)

Fixed versions

6.13.6

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences