Skip to main content
Vulnerability Database/CVE-2026-103250

CVE-2026-103250: n8n MongoDB NoSQL Injection Vulnerability

CVE-2026-103250 is a NoSQL injection flaw in n8n MongoDB Chat Memory node allowing unauthenticated attackers to access other users' conversation histories and perform unauthorized operations. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

CVE-2026-103250 Overview

n8n, the workflow automation platform, contains a NoSQL injection vulnerability in the MongoDB Chat Memory node. The flaw stems from missing validation of the sessionId parameter, which allows unauthenticated attackers to inject MongoDB query operators. Successful exploitation lets attackers read conversation histories belonging to other users and perform unauthorized write and delete operations against stored chat data. The issue is tracked under CWE-943 (Improper Neutralization of Special Elements in Data Query Logic).

Critical Impact

Unauthenticated attackers can access, modify, or delete chat conversation histories across users by injecting MongoDB operators through the sessionId parameter.

Affected Products

  • n8n versions before 1.123.80
  • n8n versions from 2.0.0 before 2.39.6
  • n8n versions from 2.40.0 before 2.40.1

Discovery Timeline

  • 2026-10-01 - CVE-2026-103250 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-103250

Vulnerability Analysis

The vulnerability resides in the MongoDB Chat Memory node of n8n, a component responsible for persisting conversational state for AI and automation workflows. The node passes a user-supplied sessionId value directly into a MongoDB query without validating that the input is a scalar string. MongoDB natively treats JSON objects containing operators such as $ne, $gt, or $regex as query predicates. An attacker who submits an object instead of a string transforms a lookup for one session into a match across many sessions. This exposes conversation histories, and the same injection surface permits write and delete operations that corrupt or destroy stored memory.

Root Cause

The node does not enforce type validation or sanitization on the sessionId parameter before building a MongoDB filter. Any client-controlled input flows into query construction, which is the classic [CWE-943] pattern for data query logic injection.

Attack Vector

Exploitation requires only network access to an exposed MongoDB Chat Memory endpoint and no authentication. An attacker submits a crafted request where sessionId is a JSON object containing a MongoDB operator rather than the expected string identifier. The resulting query matches arbitrary sessions, returning other users' chat histories or operating against them. Refer to the GitHub Security Advisory GHSA-w24g-6454-7w7f and the VulnCheck NoSQL Injection Advisory for additional technical context.

Detection Methods for CVE-2026-103250

Indicators of Compromise

  • Requests to n8n webhook or chat endpoints containing JSON objects in the sessionId field rather than string values.
  • Presence of MongoDB operator tokens such as $ne, $gt, $regex, or $where in HTTP request bodies or query parameters.
  • Unexpected read, update, or delete operations against the chat memory collection outside normal workflow activity.
  • Spikes in MongoDB query volume originating from the n8n service account.

Detection Strategies

  • Inspect HTTP request logs for sessionId values that fail to parse as plain strings.
  • Correlate n8n application logs with MongoDB audit logs to identify queries where the session filter resolves to multiple documents.
  • Hunt for anomalous deletion or update patterns on the chat memory collection.

Monitoring Recommendations

  • Enable MongoDB auditing on the collections backing the Chat Memory node and alert on operator-based filters against sessionId.
  • Forward n8n and MongoDB logs into a centralized analytics platform for cross-source correlation and retention.
  • Baseline normal sessionId cardinality per user and alert on queries returning cross-tenant result sets.

How to Mitigate CVE-2026-103250

Immediate Actions Required

  • Upgrade n8n to 1.123.80, 2.39.6, or 2.40.1 or later depending on your release branch.
  • Audit MongoDB chat memory collections for unauthorized reads, writes, or deletions since deployment of the vulnerable versions.
  • Restrict network exposure of n8n instances handling chat memory to trusted networks and authenticated users where feasible.
  • Rotate any sensitive values that may have been captured in exposed chat histories.

Patch Information

Fixes are available in n8n 1.123.80, 2.39.6, and 2.40.1. Upgrade details are published in GitHub Security Advisory GHSA-w24g-6454-7w7f. Operators running affected branches should upgrade immediately as no formal workaround is published by the vendor.

Workarounds

  • Disable or remove the MongoDB Chat Memory node from workflows until patching is complete.
  • Place n8n behind an authenticating reverse proxy and block requests whose sessionId field is not a plain string.
  • Apply a request filter at the ingress layer that rejects payloads containing $-prefixed keys inside the sessionId field.
bash
# Example ingress-level filter to reject MongoDB operators in sessionId
# (adapt to your WAF or reverse proxy of choice)
if ($request_body ~* '"sessionId"\s*:\s*\{') {
    return 400;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.