UTC
Medium

mcp-memory-keeper: Arbitrary local file read in context_import via unvalidated filePath

CVE-2026-54561 · GHSA-f7wf-v2vw-mpcx · published 2026-07-17

Severity
Medium
CVSS score
6.2
Chance of exploitation (EPSS)
0.25%
Fixed in
0.13.0
  • Exploitation Public proof of concept
  • Automatable No
  • Technical impact Partial
  • CISA SSVC
What it is

contextimport passed the caller-supplied filePath directly to fs.readFileSync with no path confinement. A malicious MCP client — or an LLM agent that is prompt-injected into calling the tool — could point filePath at any file readable by the server process, outside any session or export directory: Full disclosure (JSON files): a valid-JSON target (e.g. another user's exported session, or a .json credential / service-account file) is parsed and imported into the caller's session, then retrievable verbatim via contextget / contextexport. Partial disclosure (any file): for a non-JSON target (e.g.

What to do

Upgrade mcp-memory-keeper to 0.13.0 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.

Fixed in 0.13.0 (PR #36): Imports are confined to a server-owned exports directory ( /exports, overridable via MEMORYKEEPEREXPORT_DIR), resolved with realpathSync. File read and JSON.parse are separate operations; read/parse failures return a generic message and never echo file bytes (the SyntaxError-message leak is gone). The database-write path is likewise generic. An E2E security regression suite covers the reported arbitrary-read and traversal vectors, plus symlink escape, the directory-prefix boundary, and a no-existence-oracle check.

If you cannot upgrade yet

Upgrade to >= 0.13.0. There is no configuration-only workaround for affected versions.

Affected
PackageRegistryAffectedFixed in
mcp-memory-keepernpm< 0.13.00.13.0

The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). 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 MLflow (https://github.com/mlflow/mlflow/security/advisories); CISA Known Exploited Vulnerabilities catalog (CC0). Data as of 2026-11-22. ShieldMap describes how each problem works and how to fix it; it does not publish exploit code. Report a correction to [email protected].