Back to skill

Security audit

Soul Memory

Security checks for vulnerabilities and agentic risk

Overview

This memory skill is broadly consistent with its stated purpose, but it has serious unsafe implementation and persistence behaviors that require review before installation.

Do not install this version on a system with private memories, credentials, or network exposure without fixes. At minimum, replace shell exec with argument-array execution, remove credential keywords or add redaction before persistence, require explicit opt-in for cron and heartbeat changes, bind the web UI to localhost with authentication, pin dependencies, and run it as an unprivileged user.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
Findings (6)

T09 · Insecure Skill Coding Practices

Error
Location
plugin/index.ts:32
Finding

Arbitrary Command Execution Through Shell-Interpolated User Queries

Content
View full analysis
{ try { const effective = resolveSearchProfile(query, config); const escapedQuery = query.replace(/"/g, '\\"'); const { stdout } = await execAsync( `python3 /root/.openclaw/workspace/soul-memory/cli.py search "${escapedQuery}" --top_k ${effective.topK} --min_score ${effective.minScore}`, { timeout: 5000, cwd: '/root/.openclaw/workspace/soul-memory' } ); ``` ### Technical Analysis The plugin obtains a query from a user message and interpolates it into a command passed to Node.js `child_process.exec`. The `exec` API launches a shell, so shell syntax embedded in the query is evaluated before Python receives the argument. The implementation only escapes double quotes. This does not neutralize command substitution expressions such as `$(command)` or backtick substitution, both of which remain active inside a double-quoted shell argument. Shell metacharacters can therefore be used to execute commands under the OpenClaw process account. The 200-character query limit and command timeout do not prevent exploitation. A short command can launch a detached process, modify local files, access credentials, or establish persistence before the timeout expires. ### Attack Path 1. An attacker submits a user message containing a command-substitution expression. 2. The `before_prompt_build` hook treats the message as a memory-search query. 3. `extractQuery()` passes the attacker-controlled text to `searchMemories()`. 4. `searchMemories()` embeds the text in a command string. 5. `execAsync()` invokes a shell. 6. The shell evaluates the embedded expression before invoking `cli.py`. 7. The attacker’s command executes with the permissions of the OpenCl ...[truncated 640 chars]
Remediation
View remediation

T06 · System Persistence

Error
Location
install.sh:477
Finding

Default Installation of a Persistent Cron Job

Content
View full analysis
/dev/null | grep -q "soul_memory"; then print_warning "Soul Memory cron jobs already exist; skipping" else cat > "$CRON_TMP" << 'CRON' 59 23 * * * cd /root/.openclaw/workspace/soul-memory && /usr/bin/python3 daily-consolidate.py >> /tmp/soul_memory_consolidate.log 2>&1 CRON (crontab -l 2>/dev/null | grep -v "soul_memory" ; cat "$CRON_TMP") | crontab - rm -f "$CRON_TMP" fi ``` The default installation flow invokes the setup unconditionally: ```bash setup_heartbeat_v33 setup_cron_jobs setup_openclaw_plugin setup_environment ``` ### Technical Analysis A normal installation modifies the user’s crontab without requiring a dedicated scheduling option or explicit confirmation. The scheduled task survives the installation process, future shell sessions, and system restarts. Daily memory consolidation is related to the project’s optional maintenance functionality, but persistent scheduled execution is not required for basic memory storage, CLI search, or plugin retrieval. Enabling it by default exceeds the minimum privileges and lifecycle needed for the core functionality. The cron entry executes `daily-consolidate.py` from a user-writable project directory. If that file or directory is subsequently modified through another vulnerability, compromised update, or local account access, the modified code will execute automatically at the next scheduled interval. The cron command is also hardcoded to `/root`, even though the installer supports a custom `--path`. This can produce incorrect behavior and encourages privileged deployment. ### Attack Path 1. A user runs the documented `bash install.sh` command. 2. The installer calls `setup_cron_jobs()` without an explicit scheduling option. 3. The ...[truncated 736 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
install.sh:285
Finding

Installer Overwrites the Shared Agent Heartbeat Instruction File

Content
View full analysis
"$HEARTBEAT_FILE" << 'HEARTBEAT' # Heartbeat Tasks v3.3 ```bash python3 /root/.openclaw/workspace/soul-memory/heartbeat-trigger.py ``` If nothing needs attention, reply HEARTBEAT_OK. HEARTBEAT fi ``` ### Technical Analysis The installer uses `cat > "$HEARTBEAT_FILE"`, which replaces the complete shared `HEARTBEAT.md` file. It does not preserve unrelated existing heartbeat tasks, use a namespaced configuration file, or merge a clearly delimited block. The resulting file instructs the Agent to execute the Skill’s heartbeat script during future heartbeat processing. This creates a persistent Agent behavior change rather than a temporary operation limited to the current Skill invocation. Checking only whether the file contains the string `v3.3` is not a reliable ownership or integrity check. An existing file without that string is overwritten regardless of who created it or what instructions it contains. ### Attack Path 1. A user runs the default installer. 2. The installer locates the workspace’s shared `HEARTBEAT.md`. 3. If the file does not contain `v3.3`, the installer truncates it. 4. Existing heartbeat instructions are destroyed and replaced with Skill-controlled instructions. 5. Future heartbeat processing directs the Agent to execute `heartbeat-trigger.py`. 6. Any later compromise of that script is repeatedly activated through the persistent Agent instruction. ### Impact Assessment This can alter the Agent’s future behavior across sessions and remove unrelated operational or safety instructions. It also creates a persistent execution hook for the Ski ...[truncated 207 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
web/start.sh:8
Finding

Unauthenticated Memory API Exposed on All Network Interfaces

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
heartbeat-trigger.py:159
Finding

Heartbeat Extraction Persistently Captures Credential-Bearing Conversation Content

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
web/start.sh:4
Finding

Web Startup Installs Unpinned Third-Party Packages at Runtime

Content
View full analysis
/dev/null || python3 -m pip install -q fastapi uvicorn jinja2 ``` ### Technical Analysis Every dashboard startup attempts to install the latest available versions of `fastapi`, `uvicorn`, and `jinja2` from the active pip package index. No versions or hashes are pinned, and no isolated virtual environment is required. This makes installation non-reproducible and allows package behavior to change after the Skill has been audited. The installed artifact depends on the current package-index state, local pip configuration, mirrors, and dependency resolution. The fallback command can also result in packages being installed into a different Python environment than the first `pip3` invocation. If run by a privileged account, packages may be installed into a system-wide environment. ### Attack Path 1. A user launches `web/start.sh`. 2. The script contacts the configured Python package index. 3. Pip resolves the newest matching package and transitive dependency versions. 4. A compromised package release, unsafe mirror, or incompatible future version is installed. 5. The application imports and executes that package under the user account. 6. If startup is performed as root, package installation and execution may affect the entire system. ### Impact Assessment A compromised dependency can execute arbitrary code with the launcher’s privileges. It may access Agent memory, OpenClaw configuration, session transcripts, environment variables, and other files available to the account. Even without a malicious package, unpinned versions can introduce future vulnerabilities or break security assumptions without any change to the reviewed project. ]]>
Remediation
View remediation
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 (195)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose emphasizes a narrow heartbeat-trigger incremental-window fix, but the skill description also covers broad capabilities including prompt injection, local file modification, cron automation, plugin installation, web UI exposure, and persistent memory handling. This mismatch is dangerous because users may approve the skill for a limited maintenance change while actually granting a much broader system-integrated memory and automation component.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.