CVE-2026-49986
Cortex has Untrusted Project Bootstrap Code Execution via `CLAUDE_PROJECT_DIR`
The Cortex MCP server (neuro-cortex-memory), a cross-platform persistent memory MCP, prior to version 3.17.1 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. Version 3.17.1 fixes the issue.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.1
Cortex has Untrusted Project Bootstrap Code Execution via `CLAUDE_PROJECT_DIR`
The Cortex MCP server (neuro-cortex-memory), a cross-platform persistent memory MCP, prior to version 3.17.1 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. Version 3.17.1 fixes the issue.
- Record
CVE-2026-49986- CVSS 4.0
- 7.1 High
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 - Weakness
- CWE-829
- Updated
- 2026-11-02
EUVDEUVD-2026-58715
7.1
The Cortex MCP server (neuro-cortex-memory), a cross-platform persistent memory MCP, prior to version 3.17.1 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. Version 3.17.1 fixes the issue.
- Record
EUVD-2026-58715- CVSS 4.0
- 7.1 High
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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-gvpp-v77h-5w8g
7.1
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:
# 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:
# 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:
# 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_DIRautomatically) or the attacker otherwise controlsCLAUDE_PROJECT_DIR. - Victim invokes
/cortex-visualizeor triggers theopen_visualizationMCP tool (e.g., by selecting a visualization command in the Claude Code interface).
Inline PoC
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():
…
- Record
GHSA-gvpp-v77h-5w8g- CVSS 4.0
- 7.1 High
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 - Weakness
- CWE-829
- Updated
- 2026-11-02
NVD
7.1
The Cortex MCP server (neuro-cortex-memory), a cross-platform persistent memory MCP, prior to version 3.17.1 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. Version 3.17.1 fixes the issue.
- Record
CVE-2026-49986- CVSS 4.0
- 7.1 High
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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-829
- Updated
- 2026-11-02
OSV
7.1
Cortex has Untrusted Project Bootstrap Code Execution via `CLAUDE_PROJECT_DIR`
The Cortex MCP server (neuro-cortex-memory), a cross-platform persistent memory MCP, prior to version 3.17.1 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. Version 3.17.1 fixes the issue.
- Record
CVE-2026-49986- CVSS 4.0
- 7.1 High
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 - Weakness
- CWE-829
- Updated
- 2026-11-02
OSVGHSA-gvpp-v77h-5w8g
7.1
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:
# 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:
# 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:
# 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_DIRautomatically) or the attacker otherwise controlsCLAUDE_PROJECT_DIR. - Victim invokes
/cortex-visualizeor triggers theopen_visualizationMCP tool (e.g., by selecting a visualization command in the Claude Code interface).
Inline PoC
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():
…
- Record
GHSA-gvpp-v77h-5w8g- CVSS 4.0
- 7.1 High
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 - Weakness
- CWE-829
- Updated
- 2026-11-02
OSVPYSEC-2026-2676
7.1
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:
# 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:
# 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:
# 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_DIRautomatically) or the attacker otherwise controlsCLAUDE_PROJECT_DIR. - Victim invokes
/cortex-visualizeor triggers theopen_visualizationMCP tool (e.g., by selecting a visualization command in the Claude Code interface).
Inline PoC
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():
…
- Record
PYSEC-2026-2676- CVSS 4.0
- 7.1 High
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 - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
neuro-cortex-memoryPyPI |
through 3.17.0 | 3.18.0 |
neuro-cortex-memoryPyPI |
before 3.18.0, plus listed versions 2.0.02.1.02.4.12.5.02.5.1 Show 31 moreShow less2.5.22.6.03.0.03.1.03.10.03.10.13.11.03.12.03.12.13.12.23.13.03.13.13.13.23.14.03.14.13.14.23.14.63.14.73.2.03.4.03.4.23.4.33.5.03.6.03.7.03.7.13.7.23.7.33.8.03.9.03.9.1 |
3.18.0 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases, products | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-49986 is a high vulnerability (CVSS 7.1) in Cdeust Cortex, published July 1, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.16%, the 5th percentile. Fixed in neuro-cortex-memory 3.18.0.
References
github.com/cdeust/Cortex/security/advisories/GHSA-gvpp-v77h-5w8g
github.com/cdeust/Cortex/releases/tag/v3.17.1
github.com/pypa/advisory-database/tree/main/vulns/neuro-cortex-memory/PYSEC-2026-2676.yaml
github.com/advisories/GHSA-gvpp-v77h-5w8g
github.com/CVEProject/cvelistV5/tree/main/cves/2026/49xxx/CVE-2026-49986.json
nvd.nist.gov/vuln/detail/CVE-2026-49986
github.com/cdeust/Cortex
pypi.org/project/neuro-cortex-memory
Left out here: the rest of 3 source descriptions. The JSON record has them.