High (AgentArmorHQ estimate)Code execution

Cortex has Untrusted Project Bootstrap Code Execution via `CLAUDE_PROJECT_DIR`

Product
neuro-cortex-memory (Cortex MCP server)
CVE
CVE-2026-49986
Affected
neuro-cortex-memory <= 3.17.0
Fixed in
3.18.0

Last verified against sources: October 26, 2026

Am I affected?

neuro-cortex-memory (Cortex MCP server): affected neuro-cortex-memory <= 3.17.0. Fixed in 3.18.0.

  • Check your version: run pip show neuro-cortex-memory. Versions <= 3.17.0 of neuro-cortex-memory are affected. [1]

What to do now

  1. Upgrade to the fixed version: run pip install --upgrade "neuro-cortex-memory>=3.18.0" (first patched version 3.18.0). [1]
  2. Gate executable dev-source resolution behind an explicit opt-in flag so that only a developer who deliberately sets both CORTEX_DEV_SOURCE_SYNC=1 and CORTEX_DEV_ROOT can trigger the bootstrap path [1]

General practice, not from the source: if the affected software could read tokens or credentials, rotate them after upgrading; pin versions and review changes before updating tools your agents run.

Discuss this incident

What happened

  • The Cortex MCP server (neuro-cortex-memory) treats the CLAUDE_PROJECT_DIR environment variable as a trusted Cortex developer checkout. [1]
  • CLAUDE_PROJECT_DIR is set automatically by the Claude Code IDE extension to whichever directory the user has currently open. [1]
  • The only validation performed by _is_cortex_root() is a check for the presence of an mcp_server/ subdirectory and a ui/unified-viz.html file. [1]
  • An attacker who places these two marker files in a malicious repository can cause Cortex to execute an arbitrary mcp_server/server/visualize_bootstrap.py from that directory via subprocess.run([sys.executable, ...]). [1]

Impact

  • This is a local arbitrary code execution vulnerability. [1]
  • attacker-controlled Python code runs immediately with the full privileges of the victim's local user account [1]
  • exfiltration of files, secrets, environment variables, and SSH/GPG keys accessible to the local user [1]
  • The secondary path through http_launcher.py additionally allows the attacker to overwrite files in the Cortex plugin cache directory, potentially establishing persistence that survives after the malicious project is closed. [1]

What was done

  • Remove CLAUDE_PROJECT_DIR from the dev-source candidate list. [1]
  • Gate executable dev-source resolution behind an explicit opt-in flag so that only a developer who deliberately sets both CORTEX_DEV_SOURCE_SYNC=1 and CORTEX_DEV_ROOT can trigger the bootstrap path [1]
  • Apply the same change to mcp_server/server/http_launcher.py:80-83 to eliminate the secondary rsync execution path. [1]
  • Packages: pip/neuro-cortex-memory affected <= 3.17.0 patched 3.18.0 [1]

Sources

  1. GHSA-gvpp-v77h-5w8g — GitHub Advisory Database

Every statement above was checked against these sources before publishing. Spotted an error? Tell us and we will correct it with a dated note.

Share advisory brief with your team

Copy a plain-text summary for Slack, GitHub issues, or team security channels.

Brief
[CVE-2026-49986] Cortex has Untrusted Project Bootstrap Code Execution via `CLAUDE_PROJECT_DIR`
Product: neuro-cortex-memory (Cortex MCP server) | Affected: neuro-cortex-memory <= 3.17.0 | Fixed in: 3.18.0
Summary: The Cortex MCP server (`neuro-cortex-memory`) treats the `CLAUDE_PROJECT_DIR` environment variable as a trusted Cortex developer checkout.
Source & remediation on AgentArmorHQ: https://agentarmorhq.com/incidents/2026/07/cve-2026-49986-neuro-cortex-memory-cortex-mcp-server
Was this page useful?

Corrections

Report an error or request a correction. We review requests within 5 business days and add a dated correction note.

10 to 2,000 characters. A link to a source helps. Stored as plain text.

Discussions for CVE-2026-49986

Ask questions or share configuration tips. Governed by our Community Rules & Terms.

No posts match this filter yet.

Be the first to ask a question or share a working tip.

Check before you install

Paste a package name or a GitHub link and get a clear answer in seconds: Block, Review or No known issues. No account needed.

Check a package

Questions? Contact us