npm · PyPI
CVE-2026-116575
Mem0: Cross-tenant conversation leak via unescaped delimiter collision in session-scope key (_build_session_scope)
- Severity
- Medium 6.3
- Published
- 28 Oct 2026
- Last changed
- 28 Oct 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 2.0.18, 3.1.6
- Exploit chance
- 0.1% in the next 30 daysHigher than 1% of CVEs. EPSS by FIRST, 24 Nov 2026
- Attack
- Needs local access · Only under certain conditions · Needs a user account · No user action needed
- Attacker can
- Read data · Change data
- CVSS vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N- Also known as
- GHSA-5324-3w58-qpp2
- Sources
- OSV.dev and GitHub
Description
Summary
_build_session_scope() in mem0/memory/main.py builds the conversation-history scope key used to fetch/store the last N raw messages by naively joining caller-supplied user_id/agent_id/run_id values with unescaped & and = delimiters:
def _build_session_scope(filters): parts = [] for key in sorted(["user_id", "agent_id", "run_id"]): val = filters.get(key) if val: parts.append(f"{key}={val}") return "&".join(parts)
_validate_and_trim_entity_id() (the only validation applied to these values) rejects only empty/whitespace-only strings — it never forbids & or =. This scope string is then used as an exact-match key against a SQLite column (storage.py: WHERE session_scope = ?) to fetch the last 10 raw messages for a given scope (main.py, Phase 0 of _add_to_vector_store, both sync and async).
Impact
Any caller who controls only their own run_id (or agent_id) — a very common integration shape, since apps frequently pass a client-/session-supplied identifier straight through as…
Affected software
| Software | Affected versions |
|---|---|
mem0aiPyPI · osv:PyPI:mem0ai |
|
mem0ainpm · osv:npm:mem0ai |
|
About mem0ai
- Weekly downloads (PyPI)
- 553,838PyPI Stats, 23 Nov 2026
This is the only vulnerability in mem0ai in our list.
About mem0ai
- Weekly downloads (npm)
- 234,329npm, 23 Nov 2026
This is the only vulnerability in mem0ai in our list.
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-116575
- GitHub Advisory Database https://github.com/advisories/GHSA-5324-3w58-qpp2