medium

CVE-2026-54561

npm · mcp-memory-keeper

Summary

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

Severity
medium
CVSS
6.2
EPSS
0.2% (p16)
CWE
CWE-22, CWE-209
Also known as
GHSA-f7wf-v2vw-mpcx
Published
2026-07-17
Updated
2026-07-17

Advisory details

Impact

context_import 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:

Both ../ traversal and absolute paths worked — there was no path confinement of any kind.

In a typical MCP deployment the server runs on the developer's machine, so the reachable set includes other users' exported memory sessions, JSON credential/config files, and (in leading-bytes form) .env files, SSH keys, and /etc/passwd. The trigger is a tool argument, so the realistic threat model is an LLM agent prompt-injected into calling context_import, or any MCP client connected to the server.

Patches

Fixed in 0.13.0 (PR #36):

Workarounds

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

Resources

Credit

Reported by Zhihao Zhang (@mcfly-zzh).

References

Related advisories

Is your project exposed to this? Stateward checks every dependency on every pull request and flags it only if your code actually reaches it.

Check my repo

Summarize with AI

ChatGPTClaudePerplexity

Sources: CISA KEV (public domain), OSV.dev & GitHub Advisory Database (CC-BY-4.0), FIRST EPSS, NVD/CWE (public domain). Served live from the Stateward advisory database.