Back to skill

Security audit

cortex-memory

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a local persistent-memory skill, but users should understand it installs a changing third-party service and stores agent memory across sessions.

Before installing, review the @fozikio/cortex-engine package you will run, prefer a reviewed pinned version or local locked install when possible, and remember that observations, beliefs, ops notes, and consolidations persist across sessions. Avoid storing secrets unless that is intentional, and run the service with the least local access practical.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:18
Finding

Unpinned Global Installation of a Third-Party Dependency

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 18–25
Vulnerability Type: T08: Insecure Dependencies
Risk Level: Medium

Vulnerable Code

markdown
This skill requires [cortex-engine](https://github.com/Fozikio/cortex-engine) running as an MCP server. Install it separately before using this skill:

```bash
npm install -g @fozikio/cortex-engine

Install the scoped package, unpinned. The unscoped cortex-engine on npm is the old name and is deprecated — but old versions of it still resolve, so pinning one installs an ancient engine that works just well enough to hide the problem. Always use @fozikio/cortex-engine, and let it take the latest.

text

### Technical Analysis

The Skill explicitly instructs users to install the latest available version of `@fozikio/cortex-engine` globally instead of pinning a reviewed version. Consequently, the software ultimately installed can change after the Skill itself has been audited.

A global npm installation may execute package lifecycle scripts with the installing user's privileges and places package-provided executables into the user's global command environment. Although the package name is scoped and matches the declared upstream project, neither an exact version nor a package integrity digest is specified. The instruction to “let it take the latest” therefore creates exposure to publisher-account compromise, registry compromise, malicious release publication, or an unintentionally vulnerable future release.

### Attack Path

1. An attacker compromises the package publisher account, release pipeline, or another component capable of publishing `@fozikio/cortex-engine`.
2. The attacker publishes a malicious release under the package's latest distribution tag.
3. A user follows the Skill's documented command:
   `npm install -g @fozikio/cortex-engine`.
4. npm downloads the attacker-controlled release. Any malicious lifecycle scripts can execute 
...[truncated 1090 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace the floating installation command with an exact, reviewed version, for example:

    bash
    npm install -g @fozikio/cortex-engine@1.4.0
    

    The selected version should be independently reviewed and updated deliberately.

  2. Prefer a project-local installation governed by a committed lockfile rather than a global installation:

    bash
    npm install --save-exact @fozikio/cortex-engine@1.4.0
    
  3. Verify package provenance and integrity through npm provenance information, registry metadata, and lockfile integrity hashes before installation.

  4. Disable lifecycle scripts during installation when they are not required:

    bash
    npm install --ignore-scripts --save-exact @fozikio/cortex-engine@1.4.0
    

    If lifecycle scripts are required, review them before permitting execution.

  5. Run the MCP server under a dedicated, least-privileged account or within an appropriately constrained container or sandbox. Restrict filesystem and network access to what the memory service actually requires.

  6. Document a controlled update process that reviews release notes and package changes before changing the pinned version, rather than automatically consuming the latest release.

Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The statement that the instructions are 'read-only' and 'don't execute anything' conflicts with later guidance telling the agent to call state-changing tools such as observe, believe, ops_append, and dream. That mismatch can lower operator vigilance and cause an agent to persist data, alter beliefs, or mutate long-term memory under the false impression that the skill is non-mutating.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as a persistent memory capability, but the documented tool surface includes unrelated privileged functions such as agent invocation, social drafting, content manipulation, goals, and vitals. This broadens the effective authority of the skill beyond user expectations and creates a capability-mismatch risk where an agent or reviewer may trust a 'memory' skill that can also perform unrelated state-changing actions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Line L035 says the skill instructions are read-only and do not execute anything, implying a limited instructional scope around memory usage. Yet the same document includes operational guidance for fozikio init, up, serve, status, doctor, dashboard, and down, which are service-management actions outside the stated memory behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.