UTC
Medium

Memory saveGraph temp-path race exposes protected files through symlinked chmod

GHSA-48j5-hj63-c82c · published 2026-11-27

Severity
Medium
CVSS score
Not scored
Chance of exploitation (EPSS)
No CVE
Fixed in
2.2.2
What it is

The attacker needs a local account with write and search access to the directory containing MEMORY_FILE_PATH, access to the supported local HTTP endpoint, and a successful race against the save operation. No network exposure beyond loopback is required, but the HTTP transport is opt-in; default stdio-only installations and private graph directories are not affected by this scenario. The reproduction demonstrated an unauthorized file-permission change on a file outside the configured graph path. It did not read real secret contents or run the request as UID 1001. The conservative CVSS v3.1 Base vector is , scoring 4.2 (Medium). …

What to do

Upgrade @modelcontextprotocol/server-memory to 2.2.2 or later. If you start it from an MCP config with npx or uvx, pin that version so an old cached copy is not used.

Keep operations bound to the temporary inode created by the save. Create it exclusively without following links, retain its file handle, write and change its mode through that handle, and ensure the source pathname still identifies that inode before renaming it. Where an untrusted user can modify the graph directory, use a private directory or equivalent directory-handle protections so that user cannot replace the temporary entry during the save. …

Affected
PackageRegistryAffectedFixed in
@modelcontextprotocol/server-memorynpm>= 1.0.0, < 2.2.22.2.2
Also in @modelcontextprotocol/server-memory
  1. Mediummemory: planted symlink at the memory file leaks its target on save@modelcontextprotocol/server-memory
  2. Lowmemory: refreshLock symlink race touches any file the server user owns@modelcontextprotocol/server-memory

The impact, patch and workaround text comes from the advisory, shortened (published by the MCP reference servers project). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.

Sources: GitHub Advisory Database, reviewed and malware advisories (CC BY 4.0, https://github.com/advisories); advisories published by Cursor (https://github.com/cursor/cursor/security/advisories); advisories published by OpenClaw (https://github.com/openclaw/openclaw/security/advisories); advisories published by vLLM (https://github.com/vllm-project/vllm/security/advisories); advisories published by Open WebUI (https://github.com/open-webui/open-webui/security/advisories); advisories published by n8n (https://github.com/n8n-io/n8n/security/advisories); advisories published by Flowise (https://github.com/FlowiseAI/Flowise/security/advisories); advisories published by Langflow (https://github.com/langflow-ai/langflow/security/advisories); advisories published by the MCP Python SDK project (https://github.com/modelcontextprotocol/python-sdk/security/advisories); advisories published by the MCP reference servers project (https://github.com/modelcontextprotocol/servers/security/advisories); advisories published by the MCP Inspector project (https://github.com/modelcontextprotocol/inspector/security/advisories); advisories published by the MCP TypeScript SDK project (https://github.com/modelcontextprotocol/typescript-sdk/security/advisories); advisories published by the MCP Go SDK project (https://github.com/modelcontextprotocol/go-sdk/security/advisories); advisories published by the MCP Java SDK project (https://github.com/modelcontextprotocol/java-sdk/security/advisories); advisories published by the MCP Kotlin SDK project (https://github.com/modelcontextprotocol/kotlin-sdk/security/advisories); advisories published by the MCP Rust SDK project (https://github.com/modelcontextprotocol/rust-sdk/security/advisories); advisories published by the MCP Ruby SDK project (https://github.com/modelcontextprotocol/ruby-sdk/security/advisories); advisories published by the MCP C# SDK project (https://github.com/modelcontextprotocol/csharp-sdk/security/advisories); advisories published by the MCP PHP SDK project (https://github.com/modelcontextprotocol/php-sdk/security/advisories); advisories published by the MCP Registry project (https://github.com/modelcontextprotocol/registry/security/advisories); advisories published by Open Terminal (https://github.com/open-webui/open-terminal/security/advisories); advisories published by MLflow (https://github.com/mlflow/mlflow/security/advisories); CISA Known Exploited Vulnerabilities catalog (CC0). Data as of 2026-12-06. ShieldMap describes how each problem works and how to fix it; it does not publish exploit code. Report a correction to [email protected].