CVE-2026-106119 LangChain: MongoDBChatMessageHistory query injection can allow cross-session access
Attackers can inject MongoDB queries via session IDs to read, modify, or delete other users' chat histories in shared collections.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-106119?
CVE-2026-106119 is a medium-severity SQL injection vulnerability in @langchain langchainjs, published on 6 Oct 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Official 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.
Weakness: CWE-943
Which versions are affected by CVE-2026-106119?
2 open source packages ship an affected version, including @langchain/mongodb.
| Package | Affected | Fixed in |
|---|---|---|
@langchain/mongodb npm | All versions | 1.3.1 |
@langchain/mongodb npm | All versions | 1.3.1 |
How do I fix CVE-2026-106119?
Upgrade @langchain/mongodb to 1.3.1 or later.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2026-106119 being exploited?
There is no known exploitation of CVE-2026-106119 in the wild and no public exploit code.
Sources
Also known as GHSA-m6rx-h84q-8r95.