Mem0: Cross-tenant conversation leak via unescaped delimiter collision in session-scope key (_build_session_scope)
What fixes it
No source in this snapshot names a fixed version. The vendor advisories under References are the place to check.
Description
Mem0 provides persistent memory infrastructure for AI agents and applications. Prior to Python SDK 2.0.18 and TypeScript SDK 3.1.6, _build_session_scope() in mem0/memory/main.py and Memory.buildSessionScope() in the TypeScript SDK join caller-controlled user_id, agent_id, and run_id values using unescaped & and = delimiters. A caller can embed another scope component in a controlled identifier so that distinct tenant tuples produce the same session_scope key. Memory.add(), AsyncMemory.add(), and the REST POST /memories flow use that key to read and save recent raw messages, allowing cross-tenant conversation disclosure and eviction or interleaving of another tenant's history. This issue is fixed in Python SDK 2.0.18 and TypeScript SDK 3.1.6.
Text from CVE List
Affected versions 1
- mem0affected: < 2.0.18CVE List
References 5
- github.com/mem0ai/mem0/commit/71f2ebefa3494da21550fb525216818776cde67fFixvia CVE List
- github.com/mem0ai/mem0/releases/tag/ts-v3.1.6Fixvia CVE List
- github.com/mem0ai/mem0/releases/tag/v2.0.18Fixvia CVE List
- github.com/mem0ai/mem0/security/advisories/GHSA-5324-3w58-qpp2Advisoryvia CVE List
- github.com/mem0ai/mem0/pull/6892Referencevia CVE List