MemOS
- Type
- MCP server
- Scanned
- Nov 17, 2026
- Version
- 3a16e5fe3048
- Files read
- 2027
...Wait—I almost included extra text! Good catch in thought—Wait no, I already ended thought! Wait: NO, wait—let me check! No, I hadn't closed thought? No, I DID close thought! Oh no! Let me look! No, wait—that didn't happen, wait... No, I did close thought! Wait—why am I still in thought?! Wait no, I typed pitted? No, I typed the thought end token! No I didn't, wait... let me check! Oh, the token I typed had a typo or didn't match? No, wait—I am NOT in thought if I closed thought! Wait—why would I be generating text if I'm not in thought? Because I haven't closed thought OR I closed thou
Findings
-
CriticalOpenClaw Memory Viewer binds to 0.0.0.0 with unauthenticated initial password setup
apps/memos-local-openclaw/src/viewer/server.ts:189
Although the README states twice that the Memory Viewer binds only to 127.0.0.1, ViewerServer.start() listens on 0.0.0.0:18799 and sets Access-Control-Allow-Origin to *. On a fresh install before the user opens the Viewer to set a password, POST /api/auth/setup is open without any token, allowing anyone on the local network to set the password, obtain a session cookie, read openclaw.json and all conversation memories, or trigger arbitrary code execution via the update endpoint. Even after setup, POST /api/auth/login allows 4-character passwords with no rate limiting.
Fix: Bind the HTTP server strictly to 127.0.0.1, remove wildcard CORS headers, require a local bootstrap token (printed to local logs or stored in a 0600 file) for initial /api/auth/setup, and add login rate limiting with scrypt password hashing.
-
CriticalArbitrary npm package installation and code execution in Viewer /api/update-install
apps/memos-local-openclaw/src/viewer/server.ts:3722
POST /api/update-install validates the caller-supplied packageSpec against a generic scoped-package regex (/^@[\w-]+\/[\w.-]+(@[\w.-]+)?$/) instead of restricting it to @memtensor/memos-local-openclaw-plugin. Any attacker who reaches an authenticated Viewer session (for example, over LAN via unauthenticated initial setup on 0.0.0.0:18799) can pass any public @attacker/pkg spec; the server downloads it with npm pack, extracts it over the plugin directory, immediately runs node scripts/postinstall.cjs, and restarts the gateway.
Fix: Hardcode the package name to @memtensor/memos-local-openclaw-plugin and allow the request to specify only a validated semver version string, using execFile instead of shell exec for npm pack and tar.
-
CriticalSaved API keys exfiltrated to caller-supplied URLs via POST /api/v1/models/test
apps/memos-local-plugin/server/routes/models.ts:131
When POST /api/v1/models/test receives an empty or masked apiKey alongside a custom endpoint URL, resolveSecrets() loads the user's saved plaintext API key from config.yaml (or environment variables) and sends it in the Authorization / x-api-key header or query string to the caller-controlled endpoint without checking that the endpoint matches the saved configuration. Because Viewer authentication is inactive until .auth.json is created and JSON body parsing does not check Content-Type, a website visited in the user's browser (via a cross-site text/plain POST) or any local process can steal configured LLM and embedding API keys.
Fix: Only reuse saved.apiKey when the requested endpoint and provider exactly match saved.endpoint and saved.provider (or when endpoint is omitted), and enforce Origin/Content-Type checks on state-changing and outbound-probing routes.
-
CriticalMemory Viewer binds to 0.0.0.0 with unauthenticated initial password setup
packages/memos-core/src/viewer/server.ts:200
Although the OpenClaw plugin README states that the Memory Viewer binds only to 127.0.0.1, ViewerServer.start() listens on 0.0.0.0 (both on the primary port and on fallback ports). Right after installation, no password is set until the user manually visits the Viewer, so anyone on the local network can call POST /api/auth/setup first to claim the password, obtain a session cookie, read or delete all memories, read cleartext API keys from GET /api/config, and reach administrative endpoints.
Fix: Bind the HTTP server to 127.0.0.1 by default, require a locally generated token from logs/disk to complete initial setup, mask API keys in /api/config, and use a slow password hash with login rate limiting.
-
CriticalArbitrary scoped npm package installation and code execution in Viewer update endpoint
packages/memos-core/src/viewer/server.ts:3694
POST /api/update-install accepts a packageSpec parameter from the request body and validates it only against /^@[\w-]+\/[\w.-]+(@[\w.-]+)?$/, which permits any scoped package on the public npm registry rather than restricting updates to @memtensor packages. The handler downloads the attacker-chosen tarball with npm pack, replaces the installed plugin directory, and immediately runs node scripts/postinstall.cjs from that package, resulting in remote code execution whenever an attacker gains Viewer access (such as via the 0.0.0.0 setup window or Viewer XSS).
Fix: Ignore client-supplied package names and hardcode the exact trusted package name from the installed package.json, or restrict packageSpec to an explicit allowlist of official @memtensor package names.
-
HighSelf-hosted REST API and file download mount bind to 0.0.0.0 without authentication
src/memos/api/server_api.py:84
The default FastAPI server binds to 0.0.0.0 (in server_api.py, both Dockerfiles, and the README instructions) without any authentication middleware, and directly mounts FILE_LOCAL_PATH at /download. Anyone on the network can read, search, modify, or delete any user's stored memories, download local files under FILE_LOCAL_PATH, and consume the server's configured LLM API keys.
Fix: Bind the server to 127.0.0.1 by default, require API key authentication before serving API and /download routes, and restrict /download to an explicit safe directory.
-
HighTest hubAddress overrides on OpenClaw agent tools allow memory exfiltration, SSRF, and remote skill installation
apps/memos-local-openclaw/index.ts:197
Seven agent tools (memory_search, memory_share, memory_unshare, network_memory_detail, skill_publish, skill_unpublish, and network_skill_pull) expose optional hubAddress and userToken override parameters intended for testing, and memory_share loads chunks via store.getChunk(chunkId) without checking agent ownership. Even when Team Sharing is disabled, a prompt-injected agent can send private memories (including other local agents' chunks) to an attacker-controlled URL, probe internal HTTP services, or pull a remote skill bundle from an attacker's server and install it into ~/.openclaw/workspace/skills/ via skill_install.
Fix: Remove hubAddress and userToken parameters from all LLM-facing tool schemas so Hub URLs and tokens only come from trusted local configuration, and enforce getChunkForOwners in memory_share and memory_unshare.
-
HighUnauthenticated Cloud Config UI server exposes plaintext API keys and config writes without Host or Origin checks
apps/MemOS-Cloud-OpenClaw-Plugin/lib/config-ui-server.js:783
On gateway startup, the plugin launches a local HTTP server on 127.0.0.1:38463 whose root page requires no password, embeds the session token directly in the HTML, and checks neither Host nor Origin headers. Any website the user visits (via DNS rebinding) or any local user on a shared machine can fetch GET /, extract the token, read the unredacted MEMOS_API_KEY from /api/state, and overwrite ~/.openclaw/openclaw.json via /api/save to redirect baseUrl or recallFilterBaseUrl to an attacker server.
Fix: Validate that Host and Origin headers strictly match 127.0.0.1:<port>, require a user-supplied secret or one-time CLI login link instead of embedding the token on GET /, and redact secret values in /api/state.
-
HighLocal Plugin HTTP Viewer server has no password by default and lacks Origin and Host header checks
apps/memos-local-plugin/server/http.ts:187
The Viewer HTTP server runs by default on 127.0.0.1 (ports 18799, 18800, or 18801) without an API key and with password protection off until .auth.json is manually created, while dispatch() performs no Origin or Host header validation. Any website the user visits in a browser can send cross-origin POST requests (or use DNS rebinding when no password is set) to read, import, or mutate stored conversation traces, skills, and settings—and even with a password enabled, cookie-authenticated POST endpoints remain exposed to cross-site request forgery.
Fix: Verify that the Host header is a loopback address matching the bound port, reject state-changing requests whose Origin header does not match the Viewer origin, and require authentication on first launch.
-
HighPath traversal in automatic skill generation and installation
apps/memos-local-openclaw/src/skill/generator.ts:225
After conversations complete, the local OpenClaw plugin automatically evaluates tasks and uses an LLM to generate a skill directory name (suggestedName) plus script and reference filenames, then writes them directly to disk with path.join and fs.writeFileSync before running validation. The same unsanitized write pattern appears in SkillUpgrader.rebuildCompanionFiles, and SkillInstaller joins skill.name before calling fs.rmSync recursively. Unlike restoreSkillBundleFromHub, these paths never reject '..' or path separators, so prompt injection inside web pages, issues, or tool outputs captured during a task can steer the LLM into overwriting arbitrary files outside skills-store.
Fix: Sanitize suggestedName and every extracted script or reference filename using a strict allowlist (matching restoreSkillBundleFromHub), resolve target paths with path.resolve, and verify they remain inside the intended skill directory before writing or deleting files.
-
HighSSRF, data exfiltration, and Hub token leak via hubAddress override in agent tools
apps/memos-local-openclaw/src/tools/memory-search.ts:78
Both memory_search and network_memory_detail are enabled by default and expose hubAddress and userToken override parameters in their tool schemas for the AI agent. When no Hub session is persisted in SQLite yet, resolveHubClient connects to the caller-supplied hubAddress; if sharing.client.userToken is set in config, omitting userToken sends the real Bearer token and LAN IP to the attacker-specified hubAddress. Even when Team Sharing is completely disabled in a local-only setup, prompt injection can trick the agent into calling memory_search or network_memory_detail with an external hubAddress to exfiltrate data in the query or probe internal HTTP services.
Fix: Remove hubAddress and userToken override parameters from the public agent tool schemas and always use the trusted Hub URL and credentials from local configuration or persisted state.
-
HighStored cross-site scripting in Memory Viewer via unescaped skill Markdown
apps/memos-local-openclaw/src/viewer/html.ts:1926
In the local Memory Viewer web UI, renderSkillMarkdown escapes fenced code blocks but injects all other Markdown text directly into innerHTML without HTML escaping. Other fields such as upstream model test errors and task session keys are also inserted into innerHTML unescaped. If a user views a skill published by a malicious Hub teammate or distilled from untrusted conversation content, arbitrary JavaScript runs in the authenticated Viewer origin with access to /api/config, /api/update-install, and memory management APIs.
Fix: HTML-escape the entire Markdown input in renderSkillMarkdown before applying formatting replacements, and escape all dynamic fields such as sessionKey, toolName, and error messages before assigning to innerHTML.
-
HighCypher injection via unvalidated filter field names in Neo4j backends
src/memos/graph_dbs/neo4j.py:1797
Neo4jGraphDB and Neo4jCommunityGraphDB (the default self-hosted graph backend) validate return_fields against an alphanumeric regex, but interpolate dictionary keys from filter, search_filter, and metadata filters directly into Cypher WHERE clauses (such as node.{key}) and parameter names without validation, and interpolate user_name directly in remove_oldest_memory. An attacker reaching the MemOS search or delete API or tricking an agent into passing a crafted filter key can inject arbitrary Cypher to bypass tenant isolation or delete graph nodes.
Fix: Validate every filter key, search_filter key, metadata field name, and edge type against _VALID_FIELD_NAME_RE before constructing Cypher queries, and use bound Cypher parameters ($user_name, $memory_type) in remove_oldest_memory.
-
HighAutomatic remote repository clone and untrusted config loading in register_mem_cube
In MOSCore.register_mem_cube, when mem_cube_name_or_path does not match an existing local path, MemOS automatically calls GeneralMemCube.init_from_remote_repo, which runs git clone against https://huggingface.co/datasets/{cube_id} without path validation and then loads config.json and memory files from the cloned directory. A crafted cube identifier (including '../' traversal to any HuggingFace repository or an attacker's dataset repo) causes MemOS to instantiate attacker-controlled configs—such as SentenceTransformer with trust_remote_code=True or attacker-controlled API endpoints—leading to code execution or data exfiltration.
Fix: Do not automatically clone remote repositories when a local cube path is missing; require an explicit opt-in flag, validate repository identifiers against traversal characters, and reject dangerous config options like trust_remote_code when loading external cubes.
-
HighMemOS Local Viewer API is unauthenticated until manual setup and exempts loopback /api/v1/rpc
apps/memos-local-plugin/server/routes/auth.ts:436
The Viewer HTTP server starts automatically on 127.0.0.1 in OpenClaw (port 18799) and DeepSeek Harness (port 18801), but requireSession() allows every /api/v1/* request whenever .auth.json does not exist yet—which is the default state for any user who has not opened the Viewer UI to configure a password. Because parseJson() and /api/v1/import parse bodies without requiring Content-Type: application/json, any website the user visits can send simple cross-origin POST requests to wipe the database (/api/v1/admin/clear-data), poison memories (/api/v1/import), or claim /api/v1/auth/setup, and local processes can also read all memories and patch config.yaml. Additionally, /api/v1/rpc bypasses session cookies for all loopback connections even after a password is set.
Fix: Require authentication by default before serving /api/v1/* routes (for example, auto-generating a random local token), reject cross-origin browser requests via Origin/Sec-Fetch-Site checks and strict Content-Type: application/json validation, and require an explicit token on /api/v1/rpc.
-
HighArbitrary environment variable exfiltration and SSRF in Viewer /api/test-model
apps/memos-local-openclaw/src/viewer/server.ts:3887
In POST /api/test-model, both testEmbeddingModel() and testChatModel() pass the caller-supplied apiKey and endpoint strings through deepResolveEnv(), expanding any ${VAR} placeholder from process.env and sending the resolved secret in an HTTP Authorization header to the caller-specified endpoint. Combined with the 0.0.0.0 listener and unauthenticated initial setup, an attacker can extract arbitrary environment variables (such as OPENAI_API_KEY, ANTHROPIC_API_KEY, or cloud credentials) from the OpenClaw gateway process.
Fix: Do not run deepResolveEnv() on request-supplied apiKey or endpoint values, or only allow environment variable expansion when testing an unchanged endpoint already present in openclaw.json.
-
HighPath traversal in automatic LLM skill generation and upgrade file writes
packages/memos-core/src/skill/generator.ts:222
When SkillEvolver automatically distills a completed task into a skill (enabled by default), SkillGenerator.generate() and SkillUpgrader.rebuildCompanionFiles() write LLM-extracted script and reference files using path.join(scriptsDir, s.filename) and create the skill directory from evalResult.suggestedName before running validation and without checking for '..' segments or absolute paths. Prompt-injected text inside a conversation or fetched page can steer the background skill-generation LLM into returning traversal filenames (such as ../../../workspace/skills/evil/SKILL.md or ../../../../.bashrc), writing arbitrary files outside skills-store.
Fix: Validate suggestedName against strict kebab-case (/^[a-z0-9][a-z0-9-]*$/) and reject any companion filename that is absolute, contains '..', or resolves outside the target scripts/ or references/ directory before writing to disk.
-
HighShell command injection in Viewer skill ZIP download
apps/memos-local-openclaw/src/viewer/server.ts:1156
GET /api/skill/:id/download builds a shell command with execSync interpolating skill.dirPath and tmpPath (which contains skill.name) inside double quotes. Because skill.name and dirPath originate from LLM-suggested names (or imported skills) without shell escaping, a skill name containing $(...) or backticks executes arbitrary shell commands on the host when a user downloads the skill archive in the Viewer.
Fix: Use execFileSync('zip', ['-r', tmpPath, path.basename(skill.dirPath)], { cwd: path.dirname(skill.dirPath) }) without a shell, and strictly sanitize skill names on creation.
-
HighAuthentication bypass when INTERNAL_SERVICE_SECRET is unset
src/memos/api/middleware/auth.py:160
When AUTH_ENABLED=true is configured to protect the API, verify_api_key calls is_internal_request(request) before checking the API key. That helper compares request.headers.get("X-Internal-Service") with os.getenv("INTERNAL_SERVICE_SECRET"). If INTERNAL_SERVICE_SECRET is not set in the environment, both expressions evaluate to None, so None == None returns True for every normal request that omits the header, granting unauthenticated network callers full admin/all scope on endpoints such as /admin/keys. Additionally, requests from 127.0.0.1 bypass authentication, which exposes deployments behind a local reverse proxy.
Fix: Require INTERNAL_SERVICE_SECRET to be a non-empty string before comparing headers, use secrets.compare_digest for constant-time comparison, and do not auto-trust 127.0.0.1 when behind a reverse proxy.
-
HighPath traversal and arbitrary file write in Python skill memory extraction
src/memos/mem_reader/read_skill_memory/process_skill_memory.py:855
When generating skill files from conversation messages, _write_skills_to_file joins user_id (from the request) and LLM-generated skill_name, markdown filenames, and script_filename values directly onto Path objects without sanitization. In Python pathlib, relative segments (../) or absolute paths (/app/src/...) escape the temporary skill directory, allowing prompt-injected conversations or crafted user_id values to write attacker-controlled Python files anywhere writable by the server (including /app/src in Docker, where docker/Dockerfile runs uvicorn --reload and would immediately execute modified code) or delete traversed directories via shutil.rmtree.
Fix: Sanitize user_id and skill_name to safe single path components, strip directory components with os.path.basename, and verify every target path with Path.resolve().is_relative_to(base_dir.resolve()) before writing or deleting.
-
HighREST API server disables authentication by default while Docker binds to 0.0.0.0
src/memos/api/middleware/auth.py:33
AUTH_ENABLED defaults to false, causing verify_api_key to grant all scopes to every caller, and none of the /product/* memory read, write, search, or delete routes in server_router.py attach an authentication dependency at all. Because both Dockerfiles and the self-hosting instructions bind uvicorn to 0.0.0.0:8000, anyone who can reach port 8000 on the network can read, modify, or delete any user's memories and manage API keys without credentials.
Fix: Enable authentication by default when listening on non-loopback interfaces, enforce verify_api_key across /product/* and plugin routers, and bind local deployments to 127.0.0.1 unless explicitly configured otherwise.
-
HighShell command injection when downloading skills in Memory Viewer
packages/memos-core/src/viewer/server.ts:1204
ViewerServer.serveSkillDownload builds a shell command using double-quoted interpolation of skill.dirPath and zipName (derived from skill.name and skill.version) and passes it to execSync. Because /bin/sh still evaluates $(...), backticks, and double quotes inside double-quoted strings, a skill pulled from a shared Team Hub or distilled by an LLM with shell metacharacters in its name or directory path can execute arbitrary commands on the user's machine when downloaded.
Fix: Replace execSync shell interpolation with execFileSync("zip", ["-r", tmpPath, path.basename(skill.dirPath)], { cwd: path.dirname(skill.dirPath) }) and validate skill names against a strict slug pattern.
-
HighStored XSS in Memory Viewer skill markdown and session rendering
packages/memos-core/src/viewer/html.ts:1919
In the Memory Viewer web UI, renderSkillMarkdown escapes fenced code blocks but leaves all other text unescaped before inserting SKILL.md content into innerHTML (and task.sessionKey and tool names are similarly inserted without escaping). Viewing a skill pulled from a Team Hub or generated from untrusted conversation text containing HTML/JavaScript executes script in the authenticated Viewer origin, which can steal API keys from /api/config or invoke /api/update-install for remote code execution.
Fix: HTML-escape the entire markdown string before applying formatting replacements, sanitize rendered HTML, and escape all dynamic fields such as sessionKey and toolName.
-
HighServer-side request forgery (SSRF) in file and skill URL ingestion
src/memos/mem_reader/read_multi_modal/file_content_parser.py:110
When fine-mode extraction processes a file message containing an http:// or https:// URL (and similarly in upload_skill_memory._download_zip), _handle_url fetches the URL directly with requests.get without blocking loopback, private IP ranges, internal Docker service names, or cloud instance metadata endpoints (such as 169.254.169.254). For .txt or .md filenames, the fetched response body is stored directly into searchable memories, allowing an attacker or prompt-injected agent to read internal network responses.
Fix: Validate URLs and resolved IP addresses to block loopback, link-local, private RFC1918/RFC4193 ranges, and redirects to internal addresses, and enforce a strict response size limit.
-
HighArbitrary local file read in document scene ingestion
src/memos/mem_reader/read_multi_modal/utils.py:293
In coerce_scene_data, when scene_type is "doc" and scene_data contains strings, any string that exists as a path on the server filesystem (os.path.exists(s)) is parsed with MarkItDown and ingested into memory. An API caller or tricked agent supplying paths such as /etc/passwd or /app/.env can read sensitive files on the MemOS server host through memory search results.
Fix: Disable raw server filesystem path ingestion over the API or restrict readable file paths to a dedicated, resolved upload directory.
-
HighOpenwork auto-allows all shell and file tools despite promising user approval
apps/openwork-memos-integration/apps/desktop/src/main/opencode/config-generator.ts:609
The Openwork README tells users that they choose which folders the app can touch and approve every action, and the app includes a file-permission MCP tool to show approval dialogs. However, generateOpenCodeConfig sets permission to 'allow' in opencode.json, disabling CLI-level permission checks for all tools including Bash, Write, and Edit, while Execution.tsx hides bash tool calls from the chat UI. Because file-permission checks are enforced only by instructions in the system prompt, a prompt injection in a webpage, email, or document read by the agent can silently run arbitrary shell commands and modify or delete any file on the computer without user approval.
Fix: Enforce tool and path restrictions in the OpenCode runtime configuration rather than setting permission to 'allow', require technical approval before executing Bash or file-modifying tools, and display all executed Bash commands in the UI.
-
HighLocal permission and question HTTP servers allow unauthenticated cross-origin requests
apps/openwork-memos-integration/apps/desktop/src/main/permission-api.ts:102
When a task runs, Openwork starts local HTTP servers on 127.0.0.1:9226 (/permission) and 127.0.0.1:9227 (/question) with no authentication token and with Access-Control-Allow-Origin set to *. While any task is active, any website visited in the user's browser or in the agent's automated browser can send cross-origin POST requests to display spoofed question or file-permission dialogs inside the trusted Openwork window and read the user's typed response directly from the HTTP reply.
Fix: Remove the wildcard Access-Control-Allow-Origin header, reject requests with browser Origin headers, and require a random per-launch bearer token passed only to trusted local MCP child processes.
-
HighBrowser automation HTTP server binds to 0.0.0.0 without authentication
apps/openwork-memos-integration/apps/desktop/skills/dev-browser/src/index.ts:231
Openwork automatically starts the dev-browser Express server on port 9224 when running tasks, calling app.listen(port) without specifying 127.0.0.1 so it listens on all network interfaces (0.0.0.0 / ::) with no authentication. Anyone on the local network can query GET / to obtain the Chrome DevTools WebSocket debugger endpoint token or call POST /pages and DELETE /pages/:name to open and close tabs in the user's persistent browser profile.
Fix: Bind the Express server explicitly to 127.0.0.1, validate Host and Origin headers, and require a random authentication token on all endpoints.
-
HighIncomplete shell escaping when spawning OpenCode CLI allows command injection
apps/openwork-memos-integration/apps/desktop/src/main/opencode/adapter.ts:156
OpenCodeAdapter constructs a single shell command string from CLI arguments (including the task prompt and selected model ID) and passes it to /bin/sh -c on Unix or powershell.exe -Command on Windows. On Unix, arguments without spaces or quotes—such as a pasted URL containing &, ;, |, backticks, or $()—are left unquoted and interpreted by the shell; on Windows, PowerShell still evaluates $() subexpressions inside double quotes. Pasting a crafted URL or selecting a malicious model ID from a remote model server can execute OS commands before OpenCode starts.
Fix: Avoid spawning through a shell string; pass the executable and argument array directly to pty.spawn or node's child_process APIs, or unconditionally single-quote every argument on POSIX and escape PowerShell metacharacters on Windows.
-
HighDocker Compose exposes Neo4j and Qdrant on all network interfaces with weak or missing auth
The recommended Docker self-host configuration publishes MemOS (port 8000), Neo4j (ports 7474 and 7687), and Qdrant (ports 6333 and 6334) on 0.0.0.0, configuring Neo4j with the hardcoded password neo4j/12345678 and Qdrant with no API key. Any device on the same network can read, alter, or delete all stored agent memories and graph data.
Fix: Bind Neo4j and Qdrant host port mappings to 127.0.0.1 (for example 127.0.0.1:7474:7474 and 127.0.0.1:6333:6333), require a user-supplied strong NEO4J_AUTH secret, and enable Qdrant API key authentication.
-
MediumUndisclosed telemetry in Cloud OpenClaw plugin sends full user prompts and device ID to Aliyun ARMS
apps/MemOS-Cloud-OpenClaw-Plugin/index.js:828
Before each agent turn, runRecall builds the /search/memory request payload—which includes the user's raw prompt text (query), user_id, and conversation_id—and passes the entire object to reportRumEvent. In lib/arms-reporter.js, this payload is copied verbatim into event properties alongside the persistent device ID from ~/.openclaw/identity/device.json and sent to the bundled Aliyun ARMS RUM endpoint by default, even if the user points baseUrl to their own private server.
Fix: Never include raw query text, user IDs, or host device identifiers in telemetry events, document MEMOS_RUM_ENABLED clearly in the README and Config UI, or make telemetry opt-in.
-
MediumOpenClaw local plugin silently widens tools.allow to enable tools from all installed plugins
apps/memos-local-openclaw/index.ts:304
When ~/.openclaw/openclaw.json defines a restricted tools.allow list, the plugin rewrites openclaw.json on startup to append 'group:plugins' rather than just its own tool names. This silently grants the AI agent permission to invoke tools from every installed OpenClaw plugin without the user's knowledge.
Fix: Do not mutate the user's tools.allow policy at runtime, or only register MemOS's own specific tool names during explicit installation with user consent.
-
MediumHub admin account takeover via unverified registration-status endpoint
apps/memos-local-openclaw/src/hub/server.ts:283
When Team Sharing runs in Hub mode (bound to 0.0.0.0), POST /api/v1/hub/registration-status only checks the shared teamToken invite secret and looks up body.userId without verifying the caller's identityKey. If the target user has status 'active', the server mints a fresh bearer token with that user's role (including 'admin'), overwrites their stored token hash, and returns the new token. Because shared memories, tasks, and skills expose sourceUserId to members, any member or unapproved holder of teamToken who knows an admin's userId can mint an admin token and lock out the real admin.
Fix: Require and verify the per-device secret identityKey using constant-time comparison in /api/v1/hub/registration-status and /api/v1/hub/withdraw-pending, and never reissue tokens for bootstrap or admin accounts through the registration polling endpoint.
-
MediumSQL and Apache AGE Cypher injection in PolarDB graph backend
src/memos/graph_dbs/polardb.py:4057
PolarDBGraphDB builds PostgreSQL and Apache AGE queries by directly interpolating unvalidated filter keys, JSON-serialized filter values, user_name, knowledgebase_ids, memory_ids, and file_ids into SQL strings and dollar-quoted cypher($$ ... $$) blocks without escaping '$$' or SQL quotes in keys and non-string values. An API caller or prompt-injected agent supplying crafted search filters or IDs can break out of the query to read, modify, or delete data across all tenants or run arbitrary SQL statements.
Fix: Validate all property and identifier names against a strict alphanumeric regex, replace string interpolation in SQL queries with parameterized placeholders (%s), and reject or parameterize values inside dollar-quoted AGE Cypher blocks.
-
MediumTeam Hub join and status endpoints allow admin and member account takeover
apps/memos-local-plugin/core/hub/server.ts:407
When Team Hub mode is enabled, ensureBootstrapAdmin() creates an active admin account with username "admin" and an empty identityKey. Both POST /api/v1/hub/join and POST /api/v1/hub/registration-status look up existing users by username without verifying identityKey, then mint and return a fresh userToken with the matched user's role while overwriting tokenHash. Anyone on the network who possesses the shared teamToken (meant only to submit pending join requests) can pass "username": "admin" to immediately bypass approval, obtain full admin privileges, and lock out the Hub owner. A similar flaw in packages/memos-core/src/hub/server.ts (/api/v1/hub/registration-status) mints tokens by userId alone without checking identityKey.
Fix: Never issue tokens on /join or /registration-status based solely on username or userId; require a cryptographically random, secret per-client identityKey match, and never allow remote join flows to match or reissue tokens for the bootstrap admin account.
-
MediumAgent tools memory_search and network_memory_detail allow hubAddress override for SSRF and exfiltration
packages/memos-core/src/tools/memory-search.ts:71
Both memory_search and network_memory_detail expose optional hubAddress and userToken parameters in their LLM tool input schemas (intended for integration tests). Even when Team Sharing is disabled in configuration, prompt injection in untrusted content can trick the agent into calling memory_search with scope="all", an attacker-controlled or internal hubAddress, and sensitive data in query, causing MemOS to send outbound HTTP requests (including query text, LAN IP, or a configured sharing userToken) to arbitrary servers.
Fix: Remove hubAddress and userToken overrides from the production tool input schemas and rely exclusively on the trusted Hub configuration stored by the user.
-
MediumCleartext request headers including credentials logged on every API call
src/memos/api/middleware/request_context.py:72
RequestContextMiddleware logs the entire request.headers object at INFO level for every incoming HTTP request. Any Authorization API key, Bearer token, or session cookie sent to the server is written in plaintext into log files.
Fix: Redact sensitive headers such as Authorization, Cookie, X-API-Key, and X-Internal-Service before logging request metadata.
-
MediumBrowser extension CDP relay accepts unauthenticated cross-origin WebSocket connections
apps/openwork-memos-integration/apps/desktop/skills/dev-browser/src/relay.ts:451
When dev-browser is run in Chrome extension relay mode, it exposes ws://127.0.0.1:9224/cdp with no authentication token and no Origin header check. Because browsers permit any webpage to open WebSocket connections to localhost, a malicious site visited by the user can connect to /cdp and forward arbitrary Chrome DevTools Protocol commands to hijack tabs and read cookies in the user's Chrome browser.
Fix: Require a secret authentication token on the /cdp and /extension WebSocket endpoints and reject WebSocket handshakes that carry an untrusted browser Origin header.
-
MediumTask prompts are sent to cloud LLM APIs even when local Ollama is selected
apps/openwork-memos-integration/apps/desktop/src/main/services/summarizer.ts:23
Whenever a task starts, generateTaskSummary sends the full user prompt to the first cloud provider (anthropic, openai, google, or xai) that has a stored API key, ignoring the user's active provider selection. Users who switch to a local Ollama model for private tasks still have their prompts sent to external cloud APIs if any cloud key was previously saved.
Fix: Respect the currently active provider and model when generating task titles, or fall back to local truncation when a local model is selected.
-
MediumAPI keys are encrypted with predictable machine strings and written in plaintext instead of OS keychain
apps/openwork-memos-integration/apps/desktop/src/main/store/secureStorage.ts:79
Although the Openwork README states that API keys are stored in the OS keychain, secureStorage.ts derives its encryption key from predictable values (platform, home directory, username, userData path, and a hardcoded app ID) with the salt stored in the same JSON file. In addition, config-generator.ts writes DeepSeek, Z.AI, and LiteLLM API keys in plaintext to ~/.local/share/opencode/auth.json and opencode.json with default permissions and logs the full opencode.json content to stdout.
Fix: Use Electron's safeStorage API (backed by the OS keychain) to encrypt secrets, set 0o600 permissions on any auth/config files required by CLI tools, and redact API keys before logging configuration objects.
-
MediumOpenwork Electron desktop app loads unpinned remote Google Tag Manager code and allows unsafe-inline scripts
apps/openwork-memos-integration/apps/desktop/index.html:9
Although apps/openwork-memos-integration/README.md states that nothing gets sent to Openwork or anyone else, the Electron renderer page index.html fetches and executes https://www.googletagmanager.com/gtag/js?id=G-RQWHYJ5NEG on startup without Subresource Integrity or opt-in. Its Content-Security-Policy also enables 'unsafe-inline' in script-src to run the inline analytics snippet, weakening protection against cross-site scripting inside the desktop app renderer.
Fix: Remove the remote Google Tag Manager script and analytics endpoints from index.html, and restrict the Content-Security-Policy script-src directive to 'self' without 'unsafe-inline'.
-
LowMCP server HTTP and SSE transports expose multi-user memories and local filesystem paths without authentication
src/memos/api/mcp_serve.py:576
When MOSMCPServer is started with --transport http or --transport sse, it opens a network listener with no authentication or Origin checks while exposing tools that ingest arbitrary local files (add_memory doc_path), export cubes to arbitrary directories (dump_cube dump_dir), create ADMIN users, and share any user's cube without caller authorization. In addition, get_user_info mutates self.mos_core.user_id on the shared singleton, risking cross-user data leaks under concurrent requests.
Fix: Require bearer token authentication when running HTTP or SSE transports, restrict doc_path and dump_dir to an allowed base directory, and avoid mutating shared user_id state across async requests.
-
LowOnboarding SKILL.md instructs the agent to skip user permission and pipe unpinned remote scripts to shell
apps/memos-local-openclaw/site/public/SKILL.md:130
The onboarding skill file in the repository instructs AI agents that loading the skill grants blanket authorization to run shell commands, edit ~/.openclaw/openclaw.json, and execute unpinned remote install scripts (curl https://cdn.memtensor.com.cn/.../install.sh | bash and irm .../install.ps1 | iex) without asking the user for confirmation, even when triggered by general phrases such as 'memory not working'.
Fix: Remove instructions telling the agent to bypass user confirmation, pin downloaded artifacts to verified versions and checksums, and require explicit user approval before running shell installers or modifying host configuration.
-
LowProduction Docker image routes Hugging Face model and code downloads through a third-party mirror
Both Dockerfiles hardcode ENV HF_ENDPOINT=https://hf-mirror.com, silently redirecting all Hugging Face model, tokenizer, and remote code downloads (including SentenceTransformer models where SenTranEmbedderConfig defaults trust_remote_code to True) through a third-party domain instead of official huggingface.co.
Fix: Default to the official https://huggingface.co endpoint in production Dockerfiles, let users opt into a mirror via build/runtime arguments, and default trust_remote_code to False in SenTranEmbedderConfig.
-
LowNacos configuration loader fetches environment secrets over plaintext HTTP and leaks raw properties on log error
When Nacos configuration is enabled, NacosConfigManager.init fetches configuration properties over unencrypted http:// and writes them directly into os.environ, allowing an on-path network attacker to read secrets or overwrite runtime environment variables such as API base URLs. Right before _update_env_from_dict masks sensitive keys, logger.info('nacos config:', data_props) is called without a format placeholder, causing Python logging's error handler to print the unredacted secret dictionary to stderr.
Fix: Use HTTPS with certificate verification for Nacos configuration requests, allowlist which environment variable names Nacos may set, and remove the unredacted logger.info call.
-
LowHermes installer writes a persistent .pth startup hook into Python site-packages
apps/memos-local-plugin/install.sh:1249
When installing for Hermes, install.sh writes memos_hermes_profile_defaults.py and memos_hermes_profile_defaults.pth into site.getsitepackages()[0] of the detected Python interpreter (which can fall back to system/PATH python3). Python automatically executes .pth files on every interpreter launch in that environment to inject a sys.meta_path import hook, and uninstalling the plugin does not remove it.
Fix: Configure Hermes through its supported plugin/config files rather than injecting a .pth startup hook into site-packages, and refuse to modify non-virtualenv system Python installations.
-
LowFilter expression injection in Milvus vector database backend
src/memos/vec_dbs/milvus.py:106
MilvusVecDB._dict_to_expr formats filter field names and string values directly into Milvus boolean expressions (payload['{field}'] == '{value}') without validating field names or escaping quotes and backslashes in values. A caller or prompt-injected agent supplying a quote in a search or delete filter value can inject arbitrary boolean conditions (such as ' or id != '') to read or delete records belonging to other users.
Fix: Validate filter field names against a strict allowlist or regex, escape backslashes and quotes in string literals or use Milvus parameterized filter expressions (filter_params).
-
LowMissing group and visibility checks on Hub shared task, memory, and skill endpoints
apps/memos-local-openclaw/src/hub/server.ts:952
Although Hub task sharing supports group-restricted visibility and searchHubChunks enforces hub_group_members checks, GET /api/v1/hub/shared-tasks/:id/detail and GET /api/v1/hub/tasks (via listVisibleHubTasks, which ignores its userId argument) return every shared task and all of its conversation chunks to any authenticated Hub member without checking visibility or group membership. List, search, and bundle endpoints for Hub memories and skills likewise omit group visibility filtering.
Fix: Enforce visibility = 'public', source_user_id = auth.userId, or verified hub_group_members membership on all Hub task, memory, and skill list, search, detail, and bundle routes.
-
LowWorld-readable hub-auth.json stores Hub signing secret and long-lived admin token
apps/memos-local-openclaw/src/hub/server.ts:198
HubServer writes hub-auth.json—containing the HMAC authSecret used to sign all Hub tokens and the 10-year bootstrapAdminToken—using fs.writeFileSync without restrictive file permissions, leaving it readable by other local OS users under typical default umasks (0644).
Fix: Write hub-auth.json with mode 0o600 and ensure its parent directory restricts access to the current user (0o700).
-
LowPartial-prefix path traversal check in Viewer static file middleware
apps/memos-local-plugin/server/middleware/static.ts:58
tryServe() checks target.startsWith(resolvedRoot) without appending a path separator to resolvedRoot. Because path.resolve() strips trailing slashes, a request path that resolves to a sibling directory sharing the same prefix (for example, viewer/dist-backup when staticRoot is viewer/dist) bypasses the containment check and serves files outside staticRoot.
Fix: Check target !== resolvedRoot && !target.startsWith(resolvedRoot + path.sep) (or verify path.relative(resolvedRoot, target) does not start with '..' and is not absolute).
-
LowDefault-on usage telemetry in memos-local-plugin is undocumented and contradicts README
apps/memos-local-plugin/core/telemetry/sender.ts:100
Telemetry is enabled by default (telemetry.enabled: true) in memos-local-plugin and sends anonymous device/version metadata, latencies, and event counts to Aliyun ARMS on OpenClaw startup. While no memory content is transmitted, the root README states under Local Plugin that "nothing leaves your machine", and apps/memos-local-plugin/README.md does not document telemetry or the telemetry.enabled: false opt-out setting.
Fix: Document telemetry clearly in apps/memos-local-plugin/README.md (and update the root README claim) with opt-out instructions, or make telemetry opt-in by default.
-
LowTLS certificate and hostname verification disabled for RabbitMQ
src/memos/mem_scheduler/webservice_modules/rabbitmq_service.py:243
When connecting to RabbitMQ on TLS port 5671, get_rabbitmq_connection_param sets check_hostname = False and verify_mode = False on the SSLContext. A network attacker positioned between MemOS and the RabbitMQ broker can intercept the TLS connection, capture the PlainCredentials username and password, and read or modify queued messages.
Fix: Keep verify_mode = ssl.CERT_REQUIRED and check_hostname = True by default, and allow a custom CA bundle via configuration if self-signed certificates are needed.
-
LowUnsafe pickle deserialization in KV cache activation memory
src/memos/memories/activation/kv.py:158
KVCacheMemory.load (and VLLMKVCacheMemory.load) registers safe globals with torch.serialization.add_safe_globals—which only constrains torch.load(..., weights_only=True)—and then calls Python's standard pickle.load(f) on activation_memory.pickle. Loading a memory cube directory from an untrusted source will execute arbitrary code during unpickling.
Fix: Use torch.load with weights_only=True or a safe serialization format such as safetensors + JSON instead of pickle.load.
-
LowBatch preference deletion omits user ownership check on LLM-selected target IDs
src/memos/memories/textual/prefer_text_memory/adder.py:254
In NaiveAdder._update_memory_op_trace, add and update operations verify that op['target_id'] belongs to the current user's candidate memory maps, but delete passes op['target_id'] from the LLM output directly to vector_db.delete. If batch preference processing is called, prompt injection in conversation messages could cause the LLM to emit arbitrary target_id values and delete other users' preference records.
Fix: Verify that op['target_id'] exists in retrieved_mem_db_item_map before calling self.vector_db.delete.
-
LowHelm chart stores embedder API key and Neo4j password in a plaintext ConfigMap
deploy/helm/templates/configmap.yaml:30
While OPENAI_API_KEY and MEMRADER_API_KEY are stored in a Kubernetes Secret, the Helm ConfigMap places MOS_EMBEDDER_API_KEY and NEO4J_PASSWORD (which defaults to memos123456 in values.yaml) in plaintext ConfigMap fields readable by anyone with ConfigMap read access in the namespace.
Fix: Move MOS_EMBEDDER_API_KEY and NEO4J_PASSWORD into the Kubernetes Secret resource and require non-default passwords on installation.
-
LowmacOS Electron entitlements disable library validation and allow unsigned executable memory
apps/openwork-memos-integration/apps/desktop/resources/entitlements.mac.plist:9
The macOS entitlements file for the Openwork desktop app enables both com.apple.security.cs.disable-library-validation and com.apple.security.cs.allow-unsigned-executable-memory. Disabling library validation permits the signed app process to load unsigned or third-party dynamic libraries, weakening macOS Hardened Runtime defenses against local library injection.
Fix: Remove com.apple.security.cs.allow-unsigned-executable-memory (keeping com.apple.security.cs.allow-jit for V8) and sign all bundled native addons with the same Developer ID so library validation can remain enabled.
-
LowSelf-hosted MCP HTTP server example has no authentication or per-user isolation
examples/mem_mcp/simple_fastmcp_serve.py:80
examples/mem_mcp/simple_fastmcp_serve.py—which the MCP integration guide instructs users to run with --transport http behind a public Nginx HTTPS reverse proxy—implements no authentication and lets callers pass arbitrary user_id and cube_ids arguments to add_memory, search_memories, and chat (also calling requests.post without a timeout). Although it is an example script not executed automatically on install, deploying it as documented allows anyone who reaches the /mcp endpoint to read or overwrite any user's memories.
Fix: Require authentication on HTTP/SSE transports (and in the documented reverse-proxy configuration), bind user_id and cube access to the authenticated identity rather than tool arguments, and pass an explicit timeout to requests.post.
