CVE-2026-54561: mcp-memory-keeper Arbitrary Local File Read Vulnerability

MODERATE
Advisory Identifier: GHSA-f7wf-v2vw-mpcx
CVSS 6.2
CWE-209 CWE-22
Published
Advisory Summary

CVE-2026-54561 is a MODERATE (CVSS 6.2) arbitrary local file read vulnerability (CWE-209: Generation of Error Message Containing Sensitive Information) affecting mcp-memory-keeper libraries in the npm ecosystem. The issue involves arbitrary local file read in context_import via unvalidated filepath. Remediation is available by upgrading affected packages to version 0.13.0.

CVE-2026-54561 at a Glance

CVE Identifier CVE-2026-54561
GHSA Identifier GHSA-f7wf-v2vw-mpcx
Severity MODERATE
CVSS v3.1 Base Score 6.2
CWE Classification CWE-209: Generation of Error Message Containing Sensitive Information
Affected Product mcp-memory-keeper
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-54561

To remediate this vulnerability, upgrade all affected mcp-memory-keeper dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mcp-memory-keeper fixed: 0.13.0
npm install mcp-memory-keeper@0.13.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls mcp-memory-keeper

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-54561, inspect your project dependencies using npm:

npm ls mcp-memory-keeper

Analyze the terminal output to locate any version of mcp-memory-keeper in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.13.0), your application is affected.

Note: The npm ls mcp-memory-keeper command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-209: Generation of Error Message Containing Sensitive Information, where the product generates an error message that includes sensitive information about its environment, users, or associated data. In mcp-memory-keeper, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://github.com/mcfly-zzh)).

CVE-2026-54561 Affected mcp-memory-keeper Versions

1 component(s)
Fixed Versions:
0.13.0
Product / Package Ecosystem Affected Versions Fixed Version
mcp-memory-keeper
npm
< 0.13.0
0.13.0

References

Frequently Asked Questions

What is CVE-2026-54561?
CVE-2026-54561 is a security vulnerability in mcp-memory-keeper involving Arbitrary local file read in context_import via unvalidated filePath under CWE-209: Generation of Error Message Containing Sensitive Information.
Which mcp-memory-keeper versions are affected?
Affected versions include releases prior to 0.13.0 across affected packages: mcp-memory-keeper.
What version fixes CVE-2026-54561?
Upgrading to 0.13.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mcp-memory-keeper affected?
Yes, mcp-memory-keeper is affected in releases prior to 0.13.0. Upgrade your dependency to 0.13.0 or later.
What is the CVSS score of CVE-2026-54561?
CVE-2026-54561 has a CVSS v3.1 base score of 6.2 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-54561?
CVE-2026-54561 is classified under CWE-209: Generation of Error Message Containing Sensitive Information (The product generates an error message that includes sensitive information about its environment, users, or associated data.).
How can I check npm dependencies for CVE-2026-54561?
Run the dependency tree command: 'npm ls mcp-memory-keeper'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f7wf-v2vw-mpcx",
  "modified" : "2026-07-17T19:23:07Z",
  "published" : "2026-07-17T19:23:07Z",
  "aliases" : [ "CVE-2026-54561" ],
  "summary" : "mcp-memory-keeper: Arbitrary local file read in context_import via unvalidated filePath",
  "details" : "### Impact\n\n`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:\n\n- **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`.\n- **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.\n\nBoth `../` traversal and absolute paths worked — there was no path confinement of any kind.\n\nIn 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.\n\n### Patches\n\nFixed in **0.13.0** (PR #36):\n\n- 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.\n- 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.\n- 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.\n\n### Workarounds\n\nUpgrade to **`>= 0.13.0`**. There is no configuration-only workaround for affected versions.\n\n### Resources\n\n- Report: GitHub issue #35\n- Fix: PR #36\n\n### Credit\n\nReported by Zhihao Zhang ([@mcfly-zzh](https://github.com/mcfly-zzh)).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mcp-memory-keeper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.13.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mkreyman/mcp-memory-keeper/security/advisories/GHSA-f7wf-v2vw-mpcx"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mkreyman/mcp-memory-keeper/issues/35"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mkreyman/mcp-memory-keeper/pull/36"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mkreyman/mcp-memory-keeper/commit/84f6dfa692736a34ff36e2d2cf2188b71facf73b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mkreyman/mcp-memory-keeper"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mkreyman/mcp-memory-keeper/releases/tag/v0.13.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-209", "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-17T19:23:07Z",
    "nvd_published_at" : null
  }
}