NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2024-53900: Mongoose search injection vulnerability

highCVSS 4.0 8.7 · 3.1 9.8GHSA-m7xq-9374-9rvx

Mongoose versions prior to 8.8.3, 7.8.3, 6.13.5, and 5.13.23 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.

Published Dec 2, 2024 · Updated Feb 4, 2026

Affected packages

mongoose

Ecosystem
npm
Affected
>= 8.0.0-rc0, < 8.8.3
Fixed in
8.8.3
Check
npm ls mongoose

mongoose

Ecosystem
npm
Affected
>= 7.0.0-rc0, < 7.8.3
Fixed in
7.8.3
Check
npm ls mongoose

mongoose

Ecosystem
npm
Affected
>= 6.0.0-rc0, < 6.13.5
Fixed in
6.13.5
Check
npm ls mongoose

mongoose

Ecosystem
npm
Affected
>= 3.6.0-rc0, < 5.13.23
Fixed in
5.13.23
Check
npm ls mongoose

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

Mongoose versions prior to 8.8.3, 7.8.3, 6.13.5, and 5.13.23 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.

Credited to balles, skrtheboss, ljharb.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More npm vulnerabilities

All npm entries