{"id":"GHSA-m6rx-h84q-8r95","revision":"a1abf7a1d364441ca0a4fc24177a0332","records":[{"revision":"a1abf7a1d364441ca0a4fc24177a0332","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-m6rx-h84q-8r95","aliases":["CVE-2026-106119"],"title":"LangChain: MongoDBChatMessageHistory query injection can allow cross-session access","description":"## 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.","state":0,"publishedAt":"2026-10-08T17:52:22+00:00","modifiedAt":"2026-10-08T18:00:08.9026277+00:00","affected":[{"ecosystem":"npm","name":"@langchain/mongodb","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.3.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","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":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/langchain-ai/langchainjs/security/advisories/GHSA-m6rx-h84q-8r95","https://nvd.nist.gov/vuln/detail/CVE-2026-106119","https://github.com/langchain-ai/langchainjs/pull/11672","https://github.com/langchain-ai/langchainjs/commit/946e3d856ff1f8ce7f7b9374c83f680a6ada79af","https://github.com/langchain-ai/langchainjs","https://github.com/langchain-ai/langchainjs/releases/tag/@langchain/mongodb@1.3.1"],"sourceUrl":"https://github.com/advisories/GHSA-m6rx-h84q-8r95","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-m6rx-h84q-8r95","identifiers":["GHSA-m6rx-h84q-8r95","CVE-2026-106119"]},"retained":false,"historicalAffected":[]}],"coverage":[]}