AAK-MCP-CORTEX-CVE-2026-49986-001: neuro-cortex-memory 3.17.0 or earlier (CLAUDE_PROJECT_DIR treated as a trusted source root)
- Severity
- HIGH
- Category
- Supply Chain (
supply-chain) - Scanner
agent_audit_kit/scanners/mcp_cve_pins_2026_07.py- Auto-fixable
- No.
- SARIF name
CortexClaudeProjectDirExec
What it detects
Cortex (neuro-cortex-memory), a cross-platform persistent-memory MCP server, at 3.17.0 and below treats the CLAUDE_PROJECT_DIR environment variable — which Claude Code sets automatically to whatever project is currently open — as a candidate Cortex developer checkout. When the open_visualization tool runs, _find_dev_source() resolves that directory as a source root and _is_cortex_root() validates it by looking for nothing more than an mcp_server/ subdirectory and a ui/unified-viz.html file. An attacker who ships those two marker paths in a repository gets mcp_server/server/visualize_bootstrap.py from that repository executed via subprocess.run([sys.executable, ...]), with the victim's privileges, simply because the victim opened the repo (CVE-2026-49986, HIGH). Note the fix version: the NVD text says 3.17.1, but GHSA-gvpp-v77h-5w8g records the affected range as <= 3.17.0 with 3.18.0 first patched, and no 3.17.1 was ever published to PyPI — so 3.18.0 is the floor. The distribution was later renamed to hypermnesia-mcp, whose earliest release is 3.24.0 and therefore always above this floor.
How to fix
Upgrade neuro-cortex-memory to >= 3.18.0 and pin it, or move to its successor hypermnesia-mcp (>= 3.24.0, above the affected line). Never derive a trusted code root from an environment variable the editor points at untrusted content; marker-file presence is not authentication.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-MCP-CORTEX-CVE-2026-49986-001
Limitations
Reads neuro-cortex-memory in requirements*.txt at any depth and, at the project root only, in pyproject.toml, Pipfile, package.json, .mcp.json, mcp.json, claude_desktop_config.json and the Pipfile.lock, poetry.lock, uv.lock, package-lock.json, pnpm-lock.yaml and yarn.lock lockfiles, taking the lowest version a range allows and reporting a reference that states no version. The dependency is not read when it is declared in a sub-directory manifest (services/api/pyproject.toml), in .cursor/mcp.json or .vscode/mcp.json, or in a lockfile format the reader does not parse (pdm.lock). A file over 2 MB, or a lockfile over 32 MiB, is not read. A declaration nested more than 64 levels deep in package.json, a TOML manifest or an MCP config (an MCP server more than 62) is still judged, and reported without a line; a lockfile entry keeps its line at any depth.
References
- CVE: CVE-2026-49986
- OWASP MCP Top 10: MCP04:2025 (Software Supply Chain Attacks & Dependency Tampering), MCP05:2025 (Command Injection & Execution)
- OWASP Agentic Top 10: ASI04 (Agentic Supply Chain Vulnerabilities), ASI05 (Unexpected Code Execution (RCE))
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-RCE-04
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-MCP-CORTEX-CVE-2026-49986-001.md: the page then shows that text, with the registry reference appended under it.