{"id":"CVE-2026-106119","aliases":["GHSA-m6rx-h84q-8r95"],"url":"https://o3.security/vulnerability/CVE-2026-106119","summary":"LangChain: MongoDBChatMessageHistory query injection can allow cross-session access","details":"## 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.","published":"2026-10-06T18:01:24.262Z","modified":"2026-10-21T02:54:35.049576776Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"npm","name":"@langchain/mongodb","fixedVersion":"1.3.1"}],"fix":{"url":"https://github.com/langchain-ai/langchainjs/commit/946e3d856ff1f8ce7f7b9374c83f680a6ada79af","label":"langchain-ai/langchainjs@946e3d8"},"references":[{"type":"WEB","url":"https://github.com/langchain-ai/langchainjs/releases/tag/@langchain/mongodb@1.3.1"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/106xxx/CVE-2026-106119.json"},{"type":"ADVISORY","url":"https://github.com/langchain-ai/langchainjs/security/advisories/GHSA-m6rx-h84q-8r95"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106119"},{"type":"FIX","url":"https://github.com/langchain-ai/langchainjs/commit/946e3d856ff1f8ce7f7b9374c83f680a6ada79af"},{"type":"FIX","url":"https://github.com/langchain-ai/langchainjs/pull/11672"},{"type":"PACKAGE","url":"https://github.com/langchain-ai/langchainjs"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-21T02:54:35.049576776Z"}}