Loading HuntDB...

GHSA-vg7j-7cwx-8wgw

GitHub Security Advisory

Mongoose search injection vulnerability

✓ GitHub Reviewed CRITICAL Has CVE

Advisory 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.

Affected Packages

npm mongoose
Affected versions: 8.0.0-rc0 (fixed in 8.9.5)
npm mongoose
Affected versions: 7.0.0-rc0 (fixed in 7.8.4)
npm mongoose
Affected versions: 0 (fixed in 6.13.6)

Related CVEs

Key Information

GHSA ID
GHSA-vg7j-7cwx-8wgw
Published
January 15, 2025 6:30 AM
Last Modified
October 3, 2025 3:40 PM
CVSS Score
9.0 /10
Primary Ecosystem
npm
Primary Package
mongoose
GitHub Reviewed
✓ Yes

Dataset

Last updated: November 23, 2025 6:29 AM

Data from GitHub Advisory Database. This information is provided for research and educational purposes.