Back to skill

Security audit

Cortex

Security checks for vulnerabilities and agentic risk

Overview

Cortex is a coherent memory skill, but it warrants review because installation and sync guidance can run unverified code and persist broad sensitive data.

Review this before installing. Prefer Homebrew or a pinned, verified release rather than running scripts/setup.sh as-is. Do not enable connector sync-all, scheduled sync, third-party LLM enrichment, or local HTTP/SSE serving until you have scoped sources, reviewed what data may be imported, and decided where the SQLite database should live. Treat reimport as destructive and avoid setting CORTEX_DB to anything outside the Cortex data directory.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/setup.sh:38
Finding

Unverified Remote Binary Download and Execution

Content
View full analysis
/dev/null; then curl -fSL "$DOWNLOAD_URL" -o "$INSTALL_DIR/cortex" 2>/dev/null elif command -v wget &>/dev/null; then wget -q "$DOWNLOAD_URL" -O "$INSTALL_DIR/cortex" else echo "ERROR: Need curl or wget" >&2; exit 1 fi chmod +x "$INSTALL_DIR/cortex" # Verify VERSION="$("$INSTALL_DIR/cortex" version 2>/dev/null || echo "FAILED")" ``` ### Technical Analysis The setup script downloads a precompiled executable from a remote GitHub release, marks it executable, and immediately runs it. It does not verify a cryptographic checksum or a release signature. The default version selector is `latest`, which is a mutable reference. Consequently, the effective code executed by the Skill can change after the Skill package itself has been reviewed. The existing “Verify” step only checks whether the downloaded program can execute and return a version; it does not establish authenticity or integrity. HTTPS protects the transfer in transit but does not protect against compromise of the upstream repository, maintainer account, release workflow, or published release artifact. This behavior exceeds the minimum safe privilege necessary for installation because arbitrary remote code is trusted and executed without independent validation. ### Attack Path 1. An attacker compromises the upstream GitHub repository, maintainer credentials, release automation, or release art ...[truncated 1074 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/cortex-wrapper.sh:42
Finding

Arbitrary User-Writable File Deletion Through CORTEX_DB

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill requires shell-capable support via scripts/* and documents executable commands, but it does not declare an explicit tool/permission scope. That creates ambiguity about what execution capabilities the skill expects and weakens least-privilege controls, increasing the chance an agent may invoke shell access more broadly than intended.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill markets itself as local-first and zero-cloud, but the same document advertises external connectors, HTTP/SSE service exposure, browser serving, and optional third-party LLM/embedding providers. This mismatch can mislead operators into granting trust or deployment latitude under incorrect assumptions, resulting in unreviewed network exposure or off-device data flows.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The connector sync features allow ingestion from broad external sources such as email, chat, code hosting, and cloud documents into persistent memory storage. For a skill framed as agent memory, that materially expands data collection scope and can pull in sensitive information unrelated to the immediate task, creating privacy, retention, and over-collection risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The connector documentation encourages syncing external providers but does not warn that imported mail, chats, documents, and repository content may contain secrets, personal data, or regulated information that will be persisted locally. Users may unknowingly centralize sensitive data into a long-lived SQLite store accessible to the agent and related tooling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The scheduled sync instructions automate repeated ingestion of local sessions and external-provider data without emphasizing that new sensitive content will continue to be imported over time. This increases the chance of silent data accumulation, policy drift, and retention of information the user did not intend to keep in agent memory.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The reimport command unconditionally deletes the Cortex SQLite database with rm -f "$DB" before rebuilding it, with no confirmation prompt, dry-run mode, backup, or validation of the target path. In an agent-oriented wrapper, this is risky because a user, automation, or misconfigured environment variable such as CORTEX_DB could trigger irreversible data loss more easily than in an interactive admin-only tool.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The setup script downloads and executes a prebuilt binary from a remote GitHub release without any integrity verification such as a pinned checksum or signature. That creates a supply-chain risk: if the release asset, repository, network path, or selected version is compromised, the user will install and run attacker-controlled code. The skill being described as local-first and zero-dependency does not justify unauthenticated remote code installation, and the subsequent execution of the downloaded binary for version verification increases exposure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The installer persistently modifies shell startup files to prepend a user-controlled install directory to PATH. This broadens the effect of the installation beyond the current session and can increase command hijacking risk if that directory later contains unexpected binaries or is writable by less-trusted processes. In a memory tool, persistent shell-profile modification is not strictly necessary for core functionality and should be treated as a sensitive side effect requiring explicit consent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest emphasizes a local memory layer with MCP tools, but these lines describe exposing network services on a port and serving interactive content to a browser. That is a secondary platform/server capability rather than an obvious requirement of persistent memory storage itself.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.