GHSA-f7wf-v2vw-mpcx: Path Traversal

Published Jul 17, 2026
·
Updated

Impact

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. /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 contextimport, 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 (<DATADIR>/exports, overridable via MEMORYKEEPEREXPORTDIR), 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).

Affected Software

1 affected componentFixes available
npm/mcp-memory-keeper<0.13.0
0.13.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/mcp-memory-keeper to a version that resolves this vulnerability.

    Fixed in 0.13.0
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in >= 0.13.0

Event History

Jul 17, 2026
Advisory Published
via GitHub·07:23 PM
Data Sourced
via GitHub·07:23 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of GHSA-f7wf-v2vw-mpcx?

The severity of GHSA-f7wf-v2vw-mpcx is medium with a score of 6.2.

2

What does GHSA-f7wf-v2vw-mpcx affect?

GHSA-f7wf-v2vw-mpcx affects the npm package mcp-memory-keeper.

3

How do I fix GHSA-f7wf-v2vw-mpcx?

To fix GHSA-f7wf-v2vw-mpcx, ensure proper path confinement for the caller-supplied filePath before passing it to fs.readFileSync.

4

What type of vulnerability is GHSA-f7wf-v2vw-mpcx?

GHSA-f7wf-v2vw-mpcx is classified as a Path Traversal vulnerability.

5

What could an attacker do with GHSA-f7wf-v2vw-mpcx?

An attacker exploiting GHSA-f7wf-v2vw-mpcx could read any file that the server process has permission to access.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203