All vulnerabilities
CVE-2026-106119GHSA-m6rx-h84q-8r95

@langchain/mongodb: LangChain: MongoDBChatMessageHistory query injection can allow cross-session access

langchain-ai @langchain/mongodbnpmDatabases
CVSS
6.0Medium
ExploitationNo known exploitationNot in CISA KEV, which does not prove it is unexploitedCISA KEV
Exploit odds (EPSS)0.46%Chance of exploitation activity in the next 30 days, higher than 39% of CVEs. Scored 23 Oct 2026FIRST EPSS
Fixed in1.3.1Fixed versionGitHub
Published6 Oct 2026Updated 8 Oct 2026CVE List

What fixes it

  • 1.3.1@langchain/mongodb, npmGitHubnpm install @langchain/mongodb@1.3.1

A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.

Description

Impact

MongoDBChatMessageHistory did not enforce the documented string type for session identifiers at runtime. In affected applications, a structured session identifier could be interpreted as a MongoDB query condition rather than as a literal identifier.

Applications are affected when they pass untrusted session identifier input to MongoDBChatMessageHistory and store multiple users’ histories in the same collection. An attacker who can invoke chat-history operations may be able to read, modify, or delete another user’s stored conversation.

Applications that derive the session identifier from an authenticated, server-controlled value and enforce its type are not affected by this path.

Patches

The issue is fixed in @langchain/mongodb version 1.3.1.

Users of affected versions should upgrade to version 1.3.1 or later. The patched version validates session identifiers at runtime and ensures they are compared as literal values in MongoDB queries.

Workarounds

If an immediate upgrade is not possible, applications must reject session identifiers that are not non-empty strings. Session identifiers should be derived from an authenticated, server-controlled value and must not be passed directly from an untrusted request field.

Upgrading remains the recommended remediation.

Text from GitHub Advisory Database

Affected versions 4

  • @langchain/mongodb, npm<= 1.3.0GitHub
  • langchainjsaffected: < 1.5.14CVE List
  • mongodbaffected: < 1.3.1CVE List
  • @langchain/mongodb, npmfrom first release, fixed in 1.3.1OSV

References 6