Skip to main content

mcp-memory-keeper CVE-2026-54561

| EUVDEUVD-2026-78828 MEDIUM
Path Traversal (CWE-22)
2026-07-17 https://github.com/mkreyman/mcp-memory-keeper GHSA-f7wf-v2vw-mpcx
6.2
CVSS 3.1 · Vendor: https://github.com/mkreyman/mcp-memory-keeper
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Connect to MCP server as any client (or prompt-inject LLM agent)
  2. Delivery
    Call context_import with filePath set to target credential or secret file
  3. Exploit
    Server passes path to fs.readFileSync with no confinement check
  4. Execution
    JSON target imported verbatim into attacker's session; non-JSON target leaks leading bytes in error message
  5. Impact
    Retrieve exfiltrated data via context_get or context_export

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The server must be running mcp-memory-keeper < 0.13.0. The attacker must be able to invoke the context_import MCP tool with an arbitrary filePath argument - achievable by any MCP client connected to the server without authentication (PR:N in CVSS vector), or by prompt-injecting an LLM agent that has been granted access to the MCP server's tool set. No special server configuration or non-default feature flag is required; the vulnerability is present in the default installation. Exploitation is bounded by the OS filesystem permissions of the account running the server process: files not readable by that account cannot be accessed. JSON files yield full content disclosure; non-JSON files yield only leading bytes via the SyntaxError message. There is no user-interaction requirement - the tool call alone triggers the read.

Impact

The NVD CVSS vector (AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N, 6.2) reflects that any MCP client connected to the server can trigger this without authentication - consistent with the MCP threat model where the server exposes a local tool API. Despite the AV:L designation (server runs on the developer's local machine), the effective attack surface is broader than a traditional local vulnerability: any MCP client or LLM agent with tool-call capability is a potential adversary, and prompt-injection chains the exploit to remote attacker influence without requiring direct local access. No EPSS score was provided in the input data; KEV status is not confirmed - CISA has not listed this in the Known Exploited Vulnerabilities catalog at time of analysis. However, exploitability confidence is high: the patch PR includes E2E regression tests authored specifically to reproduce the reported PoC, covering arbitrary JSON read, /etc/passwd byte leak, and ../ traversal vectors from issue #35. The real-world impact is particularly acute on developer workstations where AWS credential JSON files, GCP service-account keys, SSH private keys, and .env files routinely co-exist with MCP server processes. The CVSS score of 6.2 (Medium) may underrepresent operational risk in environments with sensitive credential files.

Exploit ScenarioDerived

An attacker embeds a prompt-injection payload in content that an LLM agent will process (for example, a malicious document or web page), instructing the agent to call context_import with filePath set to /home/developer/.config/gcloud/application_default_credentials.json. The mcp-memory-keeper server reads the GCP service-account JSON file verbatim and imports it into the attacker's session; the attacker then calls context_get or context_export to retrieve the full credentials. The regression tests in PR #36 confirm this vector reproduces exactly as described in issue #35, along with /etc/passwd byte-leak and ../ traversal variants.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 17, 2026

Arbitrary local file read in mcp-memory-keeper versions prior to 0.13.0 allows any connected MCP client or prompt-injected LLM agent to exfiltrate files readable by the server process by supplying a crafted filePath to the context_import tool. JSON files (credential files, service-account keys, other users' exported sessions) are parsed and imported into the attacker's session, then retrievable verbatim via context_get or context_export; non-JSON files (SSH keys, .env files, /etc/passwd) leak their leading bytes through a V8 SyntaxError message echoed back to the caller. No public exploit identified at time of analysis, but E2E regression tests in the fix PR confirm all three attack vectors - arbitrary JSON read, byte-leak, and ../ traversal - are reliably reproducible in affected versions.

RemediationAI

Upgrade mcp-memory-keeper to version 0.13.0 or later (npm install mcp-memory-keeper@>=0.13.0). The vendor-released patch 0.13.0 (PR #36, commit 84f6dfa692736a34ff36e2d2cf2188b71facf73b) is the only supported fix; the advisory explicitly states there is no configuration-only workaround for affected versions. After upgrading, if MEMORY_KEEPER_EXPORT_DIR is configured, point it at a dedicated empty directory rather than a home folder or any tree containing secrets, because any JSON file placed in that directory becomes importable by any MCP client. Existing exports written to the OS temp directory by versions prior to 0.13.0 must be manually moved into the new exports directory to be re-importable. If immediate upgrade is not feasible, restrict which processes and users can connect to the MCP server at the OS or network layer, and audit the server process user's readable file set for sensitive JSON credential files - these represent the highest-impact exfiltration targets. See https://github.com/mkreyman/mcp-memory-keeper/security/advisories/GHSA-f7wf-v2vw-mpcx for full advisory details.

Affected VersionsENISA

mcp-memory-keeper < 0.13.0

Affected Packages

npm mcp-memory-keeper fix: 0.13.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

mcp-memory-keeper (pkg:npm/mcp-memory-keeper) is a Node.js Model Context Protocol server that provides persistent memory and context management for LLM agents. The context_import tool accepted a caller-supplied filePath argument and passed it without any normalization or confinement directly to Node.js fs.readFileSync, the textbook CWE-22 (Improper Limitation of a Pathname to a Restricted Directory - Path Traversal) pattern. Both ../ relative traversal and absolute paths were accepted with no restriction. A secondary information-disclosure vector exploited a V8 JavaScript engine behavior: when JSON.parse receives non-JSON input it throws a SyntaxError whose message includes a snippet of the input data, and this exception message was returned verbatim to the MCP caller, leaking leading bytes of arbitrary files that cannot be JSON-parsed. The fix in 0.13.0 uses realpathSync to resolve symlinks before a directory-prefix check, separates the read and parse operations so neither error path echoes file content, and enforces a configurable exports directory (MEMORY_KEEPER_EXPORT_DIR) as the only permitted import source.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/mkreyman/mcp-memory-keeper) PRIMARY 6.2 MEDIUM
AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
vuln.today AI 6.2 MEDIUM

AV:L reflects MCP server's local deployment model; PR:N because any connected MCP client triggers the read without authentication; C:H from full JSON credential disclosure; I:N and A:N as no write or availability impact.

3.1 AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/mkreyman/mcp-memory-keeper).

CVSS VectorVendor: https://github.com/mkreyman/mcp-memory-keeper

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

DescriptionCVE.org

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:

  • 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 context_get / context_export.
  • Partial disclosure (any file): for a non-JSON target (e.g. /etc/passwd, an SSH key, a .env), JSON.parse throws and V8 includes a snippet of the file's leading bytes in the SyntaxError message, which was returned verbatim to the caller.

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

  • Imports are confined to a server-owned exports directory (<DATA_DIR>/exports, overridable via MEMORY_KEEPER_EXPORT_DIR), resolved with realpathSync. ../ traversal, absolute paths outside the directory, and symlink escapes are all rejected.
  • 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.

Workarounds

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

Resources

  • Report: GitHub issue #35
  • Fix: PR #36

Credit

Reported by Zhihao Zhang (@mcfly-zzh).

Threat Intelligence Overview

EPSS Score
0.3%
Top 78% exploitable
Prevalence
Rare
niche npm MCP memory server, limited enterprise footprint
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

31
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +31
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy