{"id":"CVE-2026-106119","aliases":["CVE-2026-106119","GHSA-m6rx-h84q-8r95"],"related":[],"kind":"vulnerability","state":"published","title":"LangChain: MongoDBChatMessageHistory query injection can allow cross-session access","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Impact\n\n`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.\n\nApplications 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.\n\nApplications that derive the session identifier from an authenticated, server-controlled value and enforce its type are not affected by this path.\n\n## Patches\n\nThe issue is fixed in `@langchain/mongodb` version **1.3.1**.\n\nUsers 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.\n\n## Workarounds\n\nIf 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.\n\nUpgrading remains the recommended remediation.","format":"markdown","source":"ghsa"}],"published":"2026-10-06T18:01:24.262Z","modified":"2026-10-08T18:00:08.902Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N","score":6,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N","score":6,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-943"],"affected":[{"ranges":[{"version":"< 1.5.14","status":"affected"}],"vendor":"langchain-ai","product":"langchainjs","source":"cvelist"},{"ranges":[{"version":"< 1.3.1","status":"affected"}],"vendor":"@langchain","product":"mongodb","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.3.1"}],"ecosystem":"npm","package":"@langchain/mongodb","purl":"pkg:npm/%40langchain/mongodb","source":"ghsa"}],"references":[{"url":"https://github.com/langchain-ai/langchainjs/security/advisories/GHSA-m6rx-h84q-8r95","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/langchain-ai/langchainjs/pull/11672","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/langchain-ai/langchainjs/commit/946e3d856ff1f8ce7f7b9374c83f680a6ada79af","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/langchain-ai/langchainjs/releases/tag/@langchain/mongodb@1.3.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106119","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/langchain-ai/langchainjs","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-10-06T19:45:00.727Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-106119","url":"https://www.cve.org/CVERecord?id=CVE-2026-106119","licence":"CVE Terms of Use","modified":"2026-10-06T19:45:43.997Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m6rx-h84q-8r95","url":"https://github.com/advisories/GHSA-m6rx-h84q-8r95","licence":"CC-BY-4.0","modified":"2026-10-08T18:00:08.902Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-106119","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106119","licence":"Public domain","modified":"2026-10-06T20:17:17.820Z"}],"updatedAt":"2026-11-25T22:59:42.395Z","epss":{"score":0.00463,"percentile":0.41832,"date":"2026-12-01T12:00:22.000Z"}}