A flaw in the MongoDB chat message history component of LangChain (@langchain/mongodb 1.3.0 and earlier) lets an attacker pass a structured session identifier that MongoDB treats as a query condition instead of a literal string. In a shared collection, this lets one user read, modify, or delete another user's stored conversations, which can expose sensitive prompts, business data, and PII. Exploitation likelihood is currently low: EPSS is 0.00463 (62nd percentile), there is no public exploit or Nuclei template, and it is not in CISA KEV. The package is widely used, with 3,072 downstream dependents, and has 60 other CVEs, so the exposure is broad even if each deployment needs a specific setup. Upgrade @langchain/mongodb to 1.3.1 and make sure session IDs are server-generated strings, never taken from raw client input.
What is the risk?
Medium. Exploitation needs the ability to call chat-history operations with an attacker-controlled session identifier, and the application must store multiple users' histories in one shared MongoDB collection. Complexity is low once those conditions hold, and there is no sign of active exploitation. Impact covers confidentiality (reading other users' conversations), integrity (altering history), and availability of data (deletion). Applications that use authenticated, server-controlled string identifiers are not affected. No CVSS score is published, so severity relies on the vendor's medium rating.
How does the attack unfold?
What systems are affected?
How severe is it?
What should I do?
1 step1) Upgrade @langchain/mongodb to 1.3.1 or later. 2) Until patched, validate that session IDs are plain strings (reject objects and operators such as $ne, $gt, $regex) before they reach the history class. 3) Derive session IDs on the server from the authenticated identity instead of accepting client values. 4) Consider separate collections or per-tenant scoping, and enforce least-privilege MongoDB credentials. 5) Detect: review application and MongoDB logs for queries on the chat history collection that contain operator keys in the session field, and for unusual read or delete volume across sessions. 6) Use the dependency inventory (SBOM) to find all services that import @langchain/mongodb.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-106119?
A flaw in the MongoDB chat message history component of LangChain (@langchain/mongodb 1.3.0 and earlier) lets an attacker pass a structured session identifier that MongoDB treats as a query condition instead of a literal string. In a shared collection, this lets one user read, modify, or delete another user's stored conversations, which can expose sensitive prompts, business data, and PII. Exploitation likelihood is currently low: EPSS is 0.00463 (62nd percentile), there is no public exploit or Nuclei template, and it is not in CISA KEV. The package is widely used, with 3,072 downstream dependents, and has 60 other CVEs, so the exposure is broad even if each deployment needs a specific setup. Upgrade @langchain/mongodb to 1.3.1 and make sure session IDs are server-generated strings, never taken from raw client input.
Is CVE-2026-106119 actively exploited?
No confirmed active exploitation of CVE-2026-106119 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-106119?
1) Upgrade @langchain/mongodb to 1.3.1 or later. 2) Until patched, validate that session IDs are plain strings (reject objects and operators such as $ne, $gt, $regex) before they reach the history class. 3) Derive session IDs on the server from the authenticated identity instead of accepting client values. 4) Consider separate collections or per-tenant scoping, and enforce least-privilege MongoDB credentials. 5) Detect: review application and MongoDB logs for queries on the chat history collection that contain operator keys in the session field, and for unusual read or delete volume across sessions. 6) Use the dependency inventory (SBOM) to find all services that import @langchain/mongodb.
What systems are affected by CVE-2026-106119?
This vulnerability affects the following AI/ML architecture patterns: Agent frameworks, Conversational memory stores, Multi-tenant chatbot backends, RAG pipelines.
What is the CVSS score for CVE-2026-106119?
No CVSS score has been assigned yet.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0036Data from Information RepositoriesAML.T0049Exploit Public-Facing ApplicationAML.T0080.001ThreadAML.T0092Manipulate User LLM Chat HistoryCompliance Controls Affected
What are the technical details?
Original Advisory
LangChain is a framework for building LLM-powered applications. Prior to 1.3.1, MongoDBChatMessageHistory does not enforce the documented string type for an untrusted structured session identifier at runtime, allowing the identifier to be interpreted as a MongoDB query condition rather than as a literal value when multiple users' histories are stored in a shared MongoDB collection. An attacker able to invoke chat-history operations can read, modify, or delete another user's stored conversation. Applications using authenticated, server-controlled string identifiers are not affected. This issue is fixed in version 1.3.1.
Exploitation Scenario
An attacker uses a multi-tenant AI assistant whose API takes a session_id from the request body and passes it unchanged to MongoDBChatMessageHistory. They send a JSON object such as {"$ne": null} instead of a string. MongoDB evaluates it as a query condition and matches other users' records. The attacker then reads those users' conversations, injects forged messages to manipulate later answers, or deletes the histories.
Weaknesses (CWE)
CWE-943Improper Neutralization of Special Elements in Data Query LogicPrimaryCWE-943Improper Neutralization of Special Elements in Data Query LogicPrimaryCWE-943Improper Neutralization of Special Elements in Data Query LogicCWE-943 — Improper Neutralization of Special Elements in Data Query Logic: The product generates a query intended to access or manipulate data in a data store such as a database, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended logic of the query.
Source: MITRE CWE corpus.
References
- github.com/advisories/GHSA-m6rx-h84q-8r95
- nvd.nist.gov/vuln/detail/CVE-2026-106119
- github.com/langchain-ai/langchainjs/commit/946e3d856ff1f8ce7f7b9374c83f680a6ada79af
- github.com/langchain-ai/langchainjs/pull/11672
- github.com/langchain-ai/langchainjs/releases/tag/@langchain/mongodb@1.3.1
- github.com/langchain-ai/langchainjs/security/advisories/GHSA-m6rx-h84q-8r95
Timeline
Related Vulnerabilities
CVE-2025-282810.0LangChain RequestsToolkit: SSRF exposes cloud metadata
Same package: langchainCVE-2023-345419.8LangChain: RCE via unsafe load_prompt deserialization
Same package: langchainCVE-2023-293749.8LangChain: RCE via prompt injection in LLMMathChain
Same package: langchainCVE-2023-345409.8LangChain: RCE via JiraAPIWrapper crafted input
Same package: langchainCVE-2023-362589.8LangChain: unauthenticated RCE via code injection
Same package: langchain