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
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.
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.
Upgrade to >= 0.13.0. There is no configuration-only workaround for affected versions.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| mcp-memory-keeper | npm | < 0.13.0 | 0.13.0 |
- CriticalMCP Path Traversal Allows Full-Filesystem Read and JWT Secret Exfiltration Leading to Account Takeoverlangflow, langflow-base
- Critical@zereight/mcp-gitlab: Unauthenticated arbitrary file read via `upload_markdown` enables PAT exfiltration and full account takeover@zereight/mcp-gitlab
- CriticalFlowise RCE via SQL Database Chain Nodeflowise, flowise-components
- CriticalLangroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file callslangroid
- Criticalfast-mcp-telegram: Bearer token path traversal bypasses reserved Telegram session protectionfast-mcp-telegram
- CriticalMCP Toolbox HTTP tool path parameters allow traversal to unintended endpointsgithub.com/googleapis/mcp-toolbox
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.