CVE-2026-54313: n8n: NoSQL Injection in MongoDB Node Find And Replace Operation
n8n's MongoDB node did not validate the filter value in its Find And Replace operation. A user with workflow edit access can craft a filter that matches unintended documents and overwrites them with content they control. Fixed in n8n 2.24.0.
Published Jun 16, 2026 · Updated Jul 20, 2026 · Analysis Nov 2, 2026
What an attacker can do
The Find And Replace operation takes a filter and a replacement. The filter value was passed to MongoDB as a query filter without validation. A crafted value can therefore match more or different documents than the workflow author intended, and those documents are replaced with attacker-chosen content.
The advisory does not give the payload or name the MongoDB operators involved. Its description is that unintended documents can be matched and overwritten, so the damage is to integrity. Confidentiality and availability are not listed as directly hit on n8n itself. In the 4.0 vector, the high impact falls on the connected database.
The attacker needs an n8n account that can create or edit workflows. They do not need credentials for MongoDB: the workflow uses the stored credential, so the reach equals that account's write rights. Teams that share one n8n instance across several editors, or that let non-admins build workflows against production collections, carry the risk. The advisory tags the flaw CWE-89, although it is NoSQL injection.
Who is affected
n8n on npm below 2.24.0. Only workflows that use the MongoDB node's Find And Replace operation are in scope. Check your version:
npm ls n8nThen review which workflows use the MongoDB node and which credentials they hold.
n8n
- Ecosystem
- npm
- Affected
- < 2.24.0
- Fixed in
- 2.24.0
- Check
npm ls n8n
How to fix it
Upgrade to n8n 2.24.0 or later.
npm install -g [email protected]From the advisory, temporary and incomplete measures: limit workflow creation and editing to fully trusted users, or disable the MongoDB node by adding n8n-nodes-base.mongoDb to the NODES_EXCLUDE environment variable. Consider using a MongoDB account with write access only to the collections the workflows need.
How to tell if you were hit
The advisory lists no indicators. Check workflow edit history for changes to MongoDB nodes using Find And Replace, especially filters built from expressions or incoming data. On the database side, review the MongoDB profiler or audit log for replace operations by the n8n account that touched many documents, or documents the workflow should not own. Unexpected content in collections that n8n writes to is the clearest sign.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
An authenticated user with workflow edit access could supply a malicious filter value in the MongoDB node's Find And Replace operation. The value was not validated before being passed to MongoDB as a query filter, allowing unintended documents to be matched and overwritten with attacker-controlled content.
Patches
The issue has been fixed in n8n version 2.24.0. Users should upgrade to this version or later to remediate the vulnerability.
Workarounds
If upgrading is not immediately possible, administrators should consider the following temporary mitigations:
- Limit workflow creation and editing permissions to fully trusted users only.
- Disable the MongoDB node by adding
n8n-nodes-base.mongoDbto theNODES_EXCLUDEenvironment variable.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Credited to sm1ee.
Questions
- Which MongoDB operation is affected by CVE-2026-54313?
The Find And Replace operation of the n8n MongoDB node. Its filter value was passed to MongoDB without validation.
- Does CVE-2026-54313 need MongoDB credentials?
No. The attacker needs an n8n login that can edit workflows. The workflow then acts with its stored MongoDB credential.
- Is there a patched n8n release for CVE-2026-54313?
Yes. n8n 2.24.0 and later. Versions below 2.24.0 are affected.
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. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More n8n vulnerabilities
All n8n entriesCVE-2026-86073
n8n: Per-Resource OAuth Consent Bypass via Unbound Refresh Token Resource Substitution
medium5.9Sep 10, 2026CVE-2026-86074
n8n: Instance AI Credential Setup Accepts Unvalidated Probe URL from Fetched Content
medium5.9Sep 10, 2026CVE-2026-86075
n8n: Unauthenticated Persistent Storage Exhaustion via OAuth Dynamic Client Registration Endpoint
high8.7Sep 10, 2026CVE-2026-86076
n8n: Expression Sandbox Escape via Class-Field Sanitizer Rebinding Can Lead to Code Execution
high8.7Sep 10, 2026CVE-2026-86077
n8n: Anonymous Approval-Gate Bypass via Reused resumeToken over the Chat WebSocket
medium6.3Sep 10, 2026CVE-2026-86078
n8n: Prototype Pollution via Workflow Structure Summary Can Lead to Denial of Service
medium6.0Sep 10, 2026
