DEV Community

johnettagaweraks
johnettagaweraks

Posted on

Mem0's memory namespace is an authorization boundary

Mem0's memory namespace is an authorization boundary

Mem0 provides a memory layer for applications and agents. Its self-hosted server exposes REST endpoints for creating, searching, updating, and deleting memories, with API key authentication and entities identified by user_id, agent_id, and run_id. A memory record can hold preferences, user statements, task context, and information copied from other systems.

The measured set

On 25 November 2026 at 07:48 Asia/Shanghai, the ZoomEye query title="Mem0" || http.body="Mem0" returned 1,542 observations with sub_type=all, page 1, and page size 1. The body match can include documentation, integration pages, and products that mention Mem0 without running the server. The count should be read as a discovery set, not a claim that 1,542 memory APIs are exposed.

Mem0's self-hosted server documentation lists API key authentication, a dashboard, request auditing, and OpenAPI documentation at /docs. It also warns that AUTH_DISABLED=true is for local development and should not be used in production. The most useful owned-host test is therefore not "does the dashboard load?" but "which API routes return memory data without a valid key?"

Why memory is sensitive

Memories can be written by an agent that has access to email, documents, tickets, or code. A memory record may contain a user's preferences and also a fragment of a private conversation or a credential that someone pasted into it. Search results can cross applications if the caller controls a namespace identifier without an ownership check.

A caller with a valid key for one user should not be able to read another user's memories by changing user_id. A key for an agent should not automatically become an organization-wide administrative key. Deletion and reset operations have integrity impact and can destroy evidence. API-key listing and revocation are administrative functions, not ordinary memory operations.

Remediation

Enable API-key authentication, HTTPS, and a dashboard login before exposing the server beyond a trusted network. Keep AUTH_DISABLED false. Store memory backend credentials and vector-store credentials separately from client API keys. Scope keys to the narrowest entity and operation set supported by the deployment, and rotate keys after an exposed test or suspected access.

Review the entities and request audit log for searches that crossed users, agents, or runs. Inspect API requests for missing keys, keys used from unexpected source networks, and delete or reset calls. If a public instance used the local-development authentication bypass, treat the memory database as potentially readable and preserve the logs before cleanup.

Test with two users and two agents. Confirm that each key sees only its own namespace and that a namespace substitution returns a denial. Test a read-only key against a write or delete route. After the change, remove OpenAPI exposure from public networks unless it is intentionally documented and protected.

References

Top comments (0)