CVE-2026-106119: LangChain: MongoDBChatMessageHistory query injection can allow cross-session access

Published Oct 6, 2026
·
Updated

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.

Affected Software

1 affected component
pypi/langchain-mongodb<1.3.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade LangChain to a version that resolves this vulnerability.

    Fixed in 1.3.1

Event History

Oct 6, 2026
CVE Published
via MITRE·06:01 PM
Data Sourced
via MITRE·06:01 PM
DescriptionWeakness
Data Sourced
via NVD·07:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to cross-session access?

Deployments are exposed when multiple users' chat histories are stored in a shared MongoDB collection and an untrusted caller can supply a structured session identifier to chat-history operations. Applications that use authenticated, server-controlled string identifiers are not affected.

2

What level of access does an attacker need?

The attacker must be able to invoke chat-history operations and provide the session identifier. Under those conditions, they may read, modify, or delete another user's stored conversation.

3

How can this be remediated?

Upgrade langchain-mongodb to version 1.3.1. The fix enforces the documented string type for session identifiers at runtime.

4

What can be done if an immediate upgrade is not possible?

Ensure session identifiers are authenticated, server-controlled string values rather than values supplied by untrusted users. This prevents a structured identifier from being interpreted as a MongoDB query condition.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203