n8n: MongoDB Node Update Operations Can Modify Unintended Documents
What fixes it
No source in this snapshot names a fixed version.
Description
Impact
In the MongoDB node's Update and Find And Replace operations, the update key value taken from the incoming item was not sufficiently validated. Where a workflow passes untrusted input, such as a webhook body, to one of these operations, a caller could make the node match and overwrite documents other than the one the workflow intended, or insert new documents.
Patches
The issue has been fixed in n8n versions 1.123.89, 2.45.5, 2.46.1 and 3.0.1. Users should upgrade to one of these versions or later to remediate the vulnerability.
Workarounds
If upgrading is not immediately possible, administrators should consider the following temporary mitigations:
- Restrict n8n instance access to fully trusted users only.
- Audit active workflows that use the MongoDB node with Find And Replace or Update operations and ensure the
updateKeyvalue cannot be influenced by untrusted external data. - Apply network-level controls to restrict access to webhook endpoints that feed into MongoDB update workflows.
- Disable the MongoDB node by adding
n8n-nodes-base.mongoDbto theNODES_EXCLUDEenvironment variable if it is not required. - Deactivate affected workflows until the instance is patched.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Text from GitHub Advisory Database
Affected versions 4
- n8n, npm< 1.123.89GitHub
- n8n, npm< 2.46.1GitHub
- n8n, npm< 2.45.5GitHub
- n8n, npm< 3.0.1GitHub