# CVE-2024-53900: Mongoose search injection vulnerability


- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 2 Dec 2024
- **Updated:** 6 Jan 2025
- **Also known as:** BIT-mongoose-2024-53900, CLSA-2026-1774916718, GHSA-m7xq-9374-9rvx, ROOT-APP-NPM-CVE-2024-53900

## What is CVE-2024-53900?

CVE-2024-53900 is a critical vulnerability in n/a, published on 2 Dec 2024. 

### Official description

Mongoose before 8.8.3 can improperly use $where in match, leading to search injection.

Weakness: CWE-89 (Improper Neutralization of Special Elements used in an SQL Command)

## Which versions are affected by CVE-2024-53900?

9 open source packages ship an affected version, including mongoose. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mongoose` | Bitnami | All versions | 6.13.5, 8.8.3 |
| `mongoose` | npm | From 3.6.0-rc0 | 5.13.23 |
| `mongoose` | npm | From 3.6.0-rc0 | 5.13.23 |
| `mongoose` | npm | From 6.0.0-rc0 | 6.13.5 |
| `mongoose` | npm | From 6.0.0-rc0 | 6.13.5 |
| `mongoose` | npm | From 7.0.0-rc0 | 7.8.3 |
| `mongoose` | npm | From 7.0.0-rc0 | 7.8.3 |
| `mongoose` | npm | From 8.0.0-rc0 | 8.8.3 |
| `mongoose` | npm | From 8.0.0-rc0 | 8.8.3 |

Products: Mongoosejs Mongoose.

## How do I fix CVE-2024-53900?

Upgrade mongoose to a fixed version for your release line: 6.13.5, 8.8.3, 5.13.23 or 7.8.3.

## Is CVE-2024-53900 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-53900 exists.

Public exploit code:

- Mongo Vulnub Lab...Try to Hack IT.....! (github_poc): https://github.com/Gokul-Krishnan-V-R/CVE-2024-53900
- https://github.com/www-spam/CVE-2024-53900 (github_poc): https://github.com/www-spam/CVE-2024-53900
- Mongoose < 8.8.3 - Remote Code Execution (nuclei): http/cves/2024/CVE-2024-53900.yaml

## Other vulnerabilities in n/a

- [CVE-2023-3696](https://insights.sbomify.com/CVE-2023-3696/): Prototype Pollution in automattic/mongoose (critical 10.0)
- [CVE-2019-17426](https://insights.sbomify.com/CVE-2019-17426/): Improper Input Validation in Automattic Mongoose (critical 9.1)
- [CVE-2025-23061](https://insights.sbomify.com/CVE-2025-23061/): Mongoose search injection vulnerability (critical 9.0)
- [CVE-2026-42334](https://insights.sbomify.com/CVE-2026-42334/): Mongoose: Improper Sanitization of $nor in sanitizeFilter May Allow NoSQL Injection (high 7.5)
- [CVE-2022-2564](https://insights.sbomify.com/CVE-2022-2564/): Prototype Pollution in automattic/mongoose (high 7.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-53900 and fix it if it is affected.

What it is: CVE-2024-53900 is a critical vulnerability in n/a, published on 2 Dec 2024. 
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-53900 exists.

Affected packages and fixed versions:
- mongoose (Bitnami): affected all versions; fixed in 6.13.5, 8.8.3
- mongoose (npm): affected from 3.6.0-rc0; fixed in 5.13.23
- mongoose (npm): affected from 3.6.0-rc0; fixed in 5.13.23
- mongoose (npm): affected from 6.0.0-rc0; fixed in 6.13.5
- mongoose (npm): affected from 6.0.0-rc0; fixed in 6.13.5
- mongoose (npm): affected from 7.0.0-rc0; fixed in 7.8.3
- mongoose (npm): affected from 7.0.0-rc0; fixed in 7.8.3
- mongoose (npm): affected from 8.0.0-rc0; fixed in 8.8.3
- mongoose (npm): affected from 8.0.0-rc0; fixed in 8.8.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-53900/ (Markdown: https://insights.sbomify.com/CVE-2024-53900/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-53900
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-53900
- OSV: https://osv.dev/vulnerability/CVE-2024-53900

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-53900/
Summaries are generated and may contain mistakes; the official description above is the record.
