Back to skill

Security audit

Multi Agent Memory

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent project-memory purpose, but it stores shared persistent data under a broad root-scoped path and includes unsafe helper scripts that can write outside intended folders or run injected commands if given hostile names.

Install only if you are comfortable with a Chinese-language project-memory workflow that can read, write, search, and archive data across OpenClaw project directories. Run it under a non-root account, restrict /root/.openclaw-equivalent permissions, avoid storing secrets or regulated data in shared knowledge or reports, and do not pass untrusted project or phase names until the scripts validate names and escape template substitutions safely.

Vulnerability Patterns
  • 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
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/init-project.sh:23
Finding

Command Injection Through Unescaped GNU sed Template Substitution

Content
View full analysis
"$PROJECT_DIR/context.md" # 3. 创建 todos.md echo "创建 todos.md..." sed "s/{PROJECT_NAME}/$PROJECT_NAME/g; s/{DATE}/$DATE/g" \ "$TEMPLATE_DIR/todos.md.template" > "$PROJECT_DIR/todos.md" # 4. 创建 milestones.md echo "创建 milestones.md..." DATE_TIME=$(date +'%Y-%m-%d %H:%M') sed "s/{PROJECT_NAME}/$PROJECT_NAME/g; s/{DATE} {TIME}/$DATE_TIME/g" \ "$TEMPLATE_DIR/milestones.md.template" > "$PROJECT_DIR/milestones/milestones.md" # 5. 创建每个 agent 的 status 文件 echo "创建 agent status 文件..." for agent in maker vibe commander killjoy main; do AGENT_UPPER=$(echo "$agent" | tr '[:lower:]' '[:upper:]') sed "s/{AGENT}/$AGENT_UPPER/g; s/{PROJECT_NAME}/$PROJECT_NAME/g; s/{DATE} {TIME}/$DATE_TIME/g" \ "$TEMPLATE_DIR/status.md.template" > "$PROJECT_DIR/status/$agent.md" done ``` From `scripts/create-handoff.sh`: ```bash PROJECT_NAME="$1" PHASE="$2" PROJECT_DIR="/root/.openclaw/projects/$PROJECT_NAME" TEMPLATE_DIR="/root/.openclaw/skills/multi-agent-memory/templates" DATE=$(date +'%Y-%m-%d') # 1. 创建交接文档 HANDOFF_FILE="$PROJECT_DIR/handoffs/$DATE-$PHASE-交接.md" sed "s/{PROJECT_NAME}/$PROJECT_NAME/g; s/{PHASE}/$PHASE/g; s/{DATE}/$DATE/g" \ "$TEMPLATE_DIR/handoff.md.template" > "$HANDOFF_FILE" ``` From `scripts/weekly-summary.sh`: ```bash PROJECT_NAME="$1" PROJECT_DIR="/root/.openclaw/projects/$PROJECT_NA ...[truncated 3372 chars]
Remediation
View remediation
&2 exit 1 ;; esac } validate_name "$PROJECT_NAME" validate_name "$PHASE" ``` 2. Do not construct `sed` source code by directly interpolating untrusted values. Prefer a template processor that accepts replacements as data rather than executable syntax. 3. If `sed` must be retained, escape every replacement value for: - Backslashes - Ampersands - The selected delimiter - Carriage returns and newlines Merely switching from `/` to another delimiter is insufficient because an attacker may supply that delimiter as well. 4. Reject all newline and control characters even if replacement escaping is implemented. 5. Add automated negative tests containing `/`, `;`, `&`, backslashes, newlines, and strings resembling GNU `sed` commands. 6. Run these scripts under a dedicated, non-root service account with write access only to the intended project and knowledge directories. 7. Add `set -euo pipefail` so failed validation, missing templates, and failed generation operations terminate immediately rather than leaving partially initialized state. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/init-project.sh:9
Finding

Path Traversal and Unsafe File Writes Through Unvalidated Project Names

Content
View full analysis
"$PROJECT_DIR/context.md" # 3. 创建 todos.md sed "s/{PROJECT_NAME}/$PROJECT_NAME/g; s/{DATE}/$DATE/g" \ "$TEMPLATE_DIR/todos.md.template" > "$PROJECT_DIR/todos.md" # 4. 创建 milestones.md DATE_TIME=$(date +'%Y-%m-%d %H:%M') sed "s/{PROJECT_NAME}/$PROJECT_NAME/g; s/{DATE} {TIME}/$DATE_TIME/g" \ "$TEMPLATE_DIR/milestones.md.template" > "$PROJECT_DIR/milestones/milestones.md" # 5. 创建每个 agent 的 status 文件 for agent in maker vibe commander killjoy main; do AGENT_UPPER=$(echo "$agent" | tr '[:lower:]' '[:upper:]') sed "s/{AGENT}/$AGENT_UPPER/g; s/{PROJECT_NAME}/$PROJECT_NAME/g; s/{DATE} {TIME}/$DATE_TIME/g" \ "$TEMPLATE_DIR/status.md.template" > "$PROJECT_DIR/status/$agent.md" done # 7. 创建归档目录 mkdir -p "$BASE_DIR/archive/$PROJECT_NAME" ``` From `scripts/create-handoff.sh`: ```bash PROJECT_NAME="$1" PHASE="$2" PROJECT_DIR="/root/.openclaw/projects/$PROJECT_NAME" TEMPLATE_DIR="/root/.openclaw/skills/multi-agent-memory/templates" DATE=$(date +'%Y-%m-%d') HANDOFF_FILE="$PROJECT_DIR/handoffs/$DATE-$PHASE-交接.md" sed "s/{PROJECT_NAME}/$PROJECT_NAME/g; s/{PHASE}/$PHASE/g; s/{DATE}/$DATE/g" \ "$TEMPLATE_DIR/handoff.md.template" > "$HANDOFF_FILE" cd "$PROJECT_DIR/handoffs/" ln -sf "$DATE-$PHASE-交接.md" la ...[truncated 3781 chars]
Remediation
View remediation
&2 exit 1 ;; esac ``` Apply equivalent validation to `PHASE`. Explicitly reject `.`, `..`, leading hyphens, path separators, control characters, and newline characters. 2. Canonicalize and verify containment: ```bash BASE_DIR="/root/.openclaw/projects" PROJECT_DIR="$BASE_DIR/$PROJECT_NAME" canonical_base=$(realpath -m -- "$BASE_DIR") canonical_project=$(realpath -m -- "$PROJECT_DIR") case "$canonical_project" in "$canonical_base"/*) ;; *) echo "Project path escapes the projects directory" >&2 exit 1 ;; esac ``` 3. Validate containment separately for archive destinations and every other trusted base directory. 4. Do not write through existing symbolic links. Before replacing a file: - Verify every parent component is a real directory owned by the expected account. - Reject a destination when `[ -L "$destination" ]` is true. - Generate output in a securely created temporary file inside the verified directory. - Set restrictive permissions. - Atomically rename the temporary file into place after validation. 5. Prevent cross-user modification of project directories by assigning a dedicated owner and restrictive permissions, such as `0700` for private directories or a carefully controlled group mode when sharing is required. 6. Run the scripts as a dedicated non-root account. Grant access only to the project, knowledge, and archive roots required by the Skill. 7. Add security tests covering `../`, repeated traversal, slash-containing phases, absolute-looking input, symlinked destination files, and symlinked intermediate directories. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (13)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

description 使用中文描述技能能力,而文档整体未说明是否支持其他语言,也未给出用户语言偏好的选择机制。根据语言/locale 政策,若技能隐含强制特定语言且未获用户选择或未说明合理约束,可构成自然语言策略问题。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill advertises cross-project search, knowledge sharing, version retention, reporting, handoff generation, and archival, but it does not warn users that these operations can expose data across project boundaries and persist content on disk. This lack of disclosure increases the chance that sensitive information is searched, copied, retained, or archived unexpectedly.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The architecture explicitly promotes broad retention and reuse of information across agents, projects, weekly reports, handoffs, and shared knowledge stores, but it defines no semantic restrictions for secrets, credentials, regulated data, or project-confidential content. This creates a real risk of sensitive information being copied into shared memory and then propagated far beyond its original context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation phrases are broad and include generic operational terms such as project initialization, reporting, milestone updates, and knowledge search. In an agent environment, this can cause accidental invocation during normal conversation, leading the skill to read from or write to shared project memory and files without a clearly scoped user request.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The workflow instructs agents to search the entire shared knowledge base and, elsewhere, all projects using recursive grep. In a multi-project environment, this broad discovery mechanism can expose unrelated confidential information to agents working on a different project, violating least privilege and increasing the blast radius of any accidental disclosure.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The task-completion workflow directs agents to write detailed logs and to append 'new knowledge' into shared repositories without any review, minimization, or sensitivity filtering. That pattern can easily leak proprietary designs, incident details, credentials, customer data, or other sensitive context into durable, broadly accessible documents.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The weekly archive step creates persistent tarball snapshots of project status under a long-lived archive path. Persistent storage of status history is not inherently malicious, but without retention limits, access controls, or sanitization, it increases long-term exposure of sensitive project data and preserves information that might otherwise have been corrected or removed.

Content

Scanner excerpt · SKILL.md (reported line 234)May include surrounding context.

1. 写入周报(使用模板)

2. 更新里程碑

3. 归档本周数据

mkdir -p /root/.openclaw/archive/$PROJECT/$WEEK/ tar -czf /root/.openclaw/archive/$PROJECT/$WEEK/status-snapshot.tar.gz
/root/.openclaw/projects/$PROJECT/status/

text

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This shell script presents comments, usage text, status messages, and next-step instructions entirely in Chinese. Under the policy rule for natural-language violations, forcing a specific language without user opt-in is a reportable issue unless the locale constraint is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This shell script includes user-facing natural-language text only in Chinese, beginning with the header comment and usage output. The policy allows locale constraints only when the skill offers user choice or clearly documents a justified region-specific limitation, which is not present here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code performs safety-relevant filesystem writes by creating directories and writing generated content into project files. Although there are progress messages, there is no user disclosure or confirmation that existing files may be created or overwritten under a root-owned base directory.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script's comments and all user-facing messages are in Chinese, including usage instructions and status output. This imposes a specific language on users without opt-in, which matches the language/locale policy violation criteria for natural-language content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The package description is written entirely in Chinese, which can amount to a language/locale policy issue when the skill metadata presents a single language without any indication of user opt-in or region-specific justification. In this file there is no accompanying note that the skill is intended only for Chinese-speaking users or that other language options exist.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script's comments and user-visible output such as usage text and status messages are written only in Chinese. This imposes a language choice on users without opt-in or explanation, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.