CVE-2026-106119: CWE-943: Improper Neutralization of Special Elements in Data Query Logic in langchain-ai langchainjs
Description
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.
CVSS v4.0
Score 6.0medium
Affected software
langchain-ai
langchainjs
@langchain
mongodb
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
LangChain's langchainjs framework versions prior to 1.3.1 contain an improper neutralization of special elements in data query logic (CWE-943) within the MongoDBChatMessageHistory component. The vulnerability arises because the session identifier, which should be a string, is not enforced at runtime, allowing it to be interpreted as a MongoDB query condition. This enables an attacker with the ability to invoke chat-history operations to read, modify, or delete other users' stored conversations in a shared MongoDB collection. The flaw is resolved in version 1.3.1 by enforcing the string type for the session identifier.
Potential Impact
An attacker able to invoke chat-history operations can exploit this vulnerability to read, modify, or delete another user's stored conversation data in a shared MongoDB collection. This could lead to unauthorized data access and data integrity issues. Applications that use authenticated, server-controlled string identifiers are not vulnerable to this issue.
Mitigation Recommendations
Upgrade langchainjs to version 1.3.1 or later, where this vulnerability is fixed by enforcing the string type for the session identifier. Applications using authenticated, server-controlled string identifiers are not affected and require no additional action.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-06T15:33:55.333Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6ac53b952cdf04f656d07132
Added to database: 10/06/2026, 18:19:01 UTC
Last enriched: 10/06/2026, 18:33:42 UTC
Last updated: 10/06/2026, 20:04:26 UTC
Views: 13
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.