Back to skill

Security audit

Viking 记忆系统

Security checks for vulnerabilities and agentic risk

Overview

This memory skill needs Review because it can automatically persist chats and memories, process multiple agents, send content to a hard-coded plaintext network endpoint, and exposes unsafe file read/write paths.

Install only after carefully reviewing the persistence and data-flow behavior. Disable auto-save, Feishu session capture, and cron until you have explicit consent for every agent and chat source; change OLLAMA_HOST to a trusted loopback or authenticated HTTPS service; add secret redaction; fix viking:// path validation; and make retention/downgrade operations reviewable and recoverable.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
memory-pipeline/mp_mention_detect.sh:12
Finding

Automatic disclosure of private sessions and stored memories to a hard-coded plaintext HTTP endpoint

Content
View full analysis
/dev/null | head -c 5000) ~/.openclaw/skills/memory-pipeline/scripts/mp_mention_detect.sh detect \ "$SESSION_CONTENT" "$AGENT_NAME" 2>/dev/null || true fi ``` ```bash # memory-pipeline/mp_mention_detect.sh OLLAMA_HOST="${OLLAMA_HOST:-http://192.168.5.110:11434}" EMBED_MODEL="${EMBED_MODEL:-nomic-embed-text:latest}" get_embedding() { local text="$1" local safe_text=$(echo "$text" | tr '\n' ' ' | sed 's/"/\\"/g' | head -c 8000) local tmpfile=$(mktemp) echo "{\"model\": \"$EMBED_MODEL\", \"prompt\": \"$safe_text\"}" > "$tmpfile" curl -s --max-time 30 "$OLLAMA_HOST/api/embeddings" -d @"$tmpfile" | \ python3 -c "import sys,json; print(json.dumps(json.load(sys.stdin).get('embedding', [])))" 2>/dev/null rm -f "$tmpfile" } ``` ```python # Embedded Python in memory-pipeline/mp_mention_detect.sh for mem in memories: filepath = mem['file'] content = mem['content'][:1500] data = json.dumps({ 'model': EMBED_MODEL, 'prompt': content.replace('"', '\\"').replace('\n', ' ')[:8000] }).encode('utf-8') req = urllib.request.Request( OLLAMA_HOST + '/api/embeddings', data=data, headers={'Content-Type': 'application/json'} ) with urllib.request.urlopen(req, timeout=30) as response: result = json.loads(response.read().decode()) ``` ...[truncated 2544 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
memory-pipeline/memory-extract-summary.sh:17
Finding

Persistent agent-memory poisoning through untrusted conversation transcripts

Content
View full analysis
决策: - <决策1> 待办: - [ ] <任务1> 重要性: " RESULT=$("$OPENCLAW_BIN" agent --local --agent maoxiami \ --message "$PROMPT" --json 2>/dev/null) ``` ```bash # memory-pipeline/memory-tier-cron.sh if extracted=$("$SCRIPT_DIR/memory-extract-summary.sh" \ "$agent" "$yesterday_session" "$YESTERDAY" 2>/dev/null); then local theme=$(echo "$extracted" | grep "^主题:" | sed 's/^主题: //') local decisions=$(echo "$extracted" | grep "^决策:" -A 10 | grep "^- " | head -5) local todos=$(echo "$extracted" | grep "^待办:" -A 10 | grep "^- \[ \]" | head -10) cat > "$hot_dir/$filename" << EOF --- title: "${theme:-$YESTERDAY 每日摘要}" importance: ${importance} tier: L0 auto_saved: true extraction_method: llm --- ## 原始提取信息 \`\`\` ${extracted} \`\`\` EOF fi ``` ```bash # simple-viking/sv_autoload.sh CONFIG_FILE="$SV_WORKSPACE/agent/memories/config/config.md" if [[ -f "$CONFIG_FILE" ]]; then echo "--- CONFIG ---" cat "$CONFIG_FILE" fi find "$HOT_DIR" -name "*.md" -type f -mtime -7 2>/dev/null | \ grep -v "/\." | head -5 | while read -r file; do echo "--- $(basename "$file") ---" head -c 2000 "$file" done ``` ### Technical Analysis Raw session data is concatenated into an LLM instruction without a strong data boundary or an explicit rule that commands found inside the transcript must not be followed. A malicious participant can insert prompt-injection text designed to make the summarization agent emit false decisions, high-importance instructions, f ...[truncated 1896 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
simple-viking/lib.sh:22
Finding

Arbitrary file read and overwrite through traversal in viking URI resolution

Content
View full analysis
"$target_path" sv_log INFO "已写入: $uri" ``` ### Technical Analysis The resolver strips the `viking://` prefix and concatenates the remainder with `SV_WORKSPACE`. It does not canonicalize the resulting path or reject `..` components. It also does not protect against symbolic links inside the workspace that point outside it. For example, a URI such as `viking://../../.ssh/authorized_keys` resolves textually to: ```text $SV_WORKSPACE/../../.ssh/authorized_keys ``` The operating system resolves the traversal components when `cat`, `mkdir`, or shell redirection accesses the path. Consequently, the apparent `viking://` namespace does not enforce a filesystem sandbox. ### Attack Path 1. An attacker or untrusted agent action supplies a crafted URI containing traversal components. 2. `sv_parse_uri` accepts it because it begins with `viking://`. 3. `sv_resolve_path` concatenates the unsafe path with `SV_WO ...[truncated 955 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
memory-pipeline/memory-tier-downgrade.sh:98
Finding

Scheduled downgrade can immediately and irreversibly compress memories because retention ages are not enforced

Content
View full analysis
"$target_file" if [ "$source_dir" != "$target_dir" ]; then rm -f "$file" fi done } downgrade_tier "$SV_WORKSPACE/agent/memories/hot" \ "$SV_WORKSPACE/agent/memories/hot" "L0" "L1" downgrade_tier "$SV_WORKSPACE/agent/memories/hot" \ "$SV_WORKSPACE/agent/memories/warm" "L1" "L2" downgrade_tier "$SV_WORKSPACE/agent/memories/warm" \ "$SV_WORKSPACE/agent/memories/cold" "L2" "L3" downgrade_tier "$SV_WORKSPACE/agent/memories/cold" \ "$SV_WORKSPACE/agent/memories/archive" "L3" "L4" ``` ### Technical Analysis The documented policy claims age-based transitions: - L0 to L1 after approximately one day - L1 to L2 after seven days - L2 to L3 after thirty days - L3 to L4 after ninety days The implementation do ...[truncated 1676 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
memory-pipeline/memory-tier-cron.sh:27
Finding

Optional cron persistence performs recurring cross-agent transcript collection beyond least-privilege scope

Content
View full analysis
/dev/null | head -1) fi if [ -n "$yesterday_session" ] && [ -f "$yesterday_session" ]; then extracted=$("$SCRIPT_DIR/memory-extract-summary.sh" \ "$agent" "$yesterday_session" "$YESTERDAY" 2>/dev/null) fi } ``` ```bash for agent in maojingli maoxiami maogongtou maozhuli; do export SV_WORKSPACE="$HOME/.openclaw/viking-$agent" sv build-index "$SV_WORKSPACE" 100 done ``` ### Technical Analysis Recurring execution is related to the declared automatic memory-lifecycle feature and is documented as optional. The project does not silently install the cron entry in the reviewed code. Therefore, cron usage is not independently evidence of a covert backdoor. Nevertheless, the recommended scheduled task is substantially broader than a single-agent memory operation. It uses a hard-coded list of four agents plus a global workspace, scans their recent session files, creates persistent summaries, and rebuilds indexes for all of them. There is no per-agent aut ...[truncated 1352 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (100)

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill specifically treats accounts and passwords as important memories that should not be degraded, encouraging durable retention of the most sensitive secret material. In a system with search, indexing, and multi-agent/shared workspaces, this materially increases the blast radius of any unauthorized access and can directly lead to credential theft and downstream system compromise.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly classifies highly sensitive items such as accounts and passwords as important and protected from degradation, but fails to warn that these secrets may be retained for extended periods. This increases the chance that credentials will be stored persistently in plaintext or recoverable form, raising compromise impact if memory is accessed or indexed.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill describes automatic saving of content and session summaries but does not clearly warn users that their conversation content may be persisted to long-term memory. This creates a privacy and security risk because users may disclose secrets, internal data, or regulated information without understanding that it will be retained.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The included test example explicitly demonstrates 'remember this password' as a normal, successful use case, which reinforces unsafe handling of credentials. In a memory skill, examples shape developer and operator expectations, so this materially increases the chance that secrets will be intentionally persisted in plain memory storage.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · memory-pipeline/memory-embed.sh (reported line 74)May include surrounding context.

sh
local tmpfile=$(mktemp)
    echo "{\"model\": \"$EMBED_MODEL\", \"prompt\": \"$content\"}" > "$tmpfile"
    
    embedding=$(curl -s --max-time 30 "$OLLAMA_HOST/api/embeddings" \
        -d @"$tmpfile" | python3 -c "
import sys, json
data = json.load(sys.stdin)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · memory-pipeline/memory-embed.sh (reported line 200)May include surrounding context.

sh
;;
    test)
        echo "测试 Ollama 连接..."
        curl -s "$OLLAMA_HOST/api/tags" | python3 -c "
import json, sys
data = json.load(sys.stdin)
models = data.get('models', [])

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · memory-pipeline/mp_mention_detect.sh (reported line 286)May include surrounding context.

sh
;;
    test)
        echo "测试 Ollama 连接..."
        curl -s "$OLLAMA_HOST/api/tags" | python3 -c "
import json, sys
data = json.load(sys.stdin)
models = data.get('models', [])

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The file deletion target is derived from a user-supplied workspace path, and the script performs rm -f without confirmation or strong path validation. Quoting prevents simple shell injection, but misuse or an unexpected workspace value can still delete the wrong index file, causing integrity and availability issues.

Content

Scanner excerpt · memory-pipeline/memory-embed.sh (reported line 214)May include surrounding context.

sh
echo "重建向量库: $workspace"
        
        # 删除旧索引
        rm -f "$workspace/$VECTOR_INDEX"
        
        # 遍历所有 md 文件
        find "$workspace" -name "*.md" -type f ! -name '.abstract' ! -name '.overview' | while read f; do

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · simple-viking/lib.sh (reported line 190)May include surrounding context.

sh
# 调用 Ollama API
  local response
  response=$(curl -s -s --max-time 30 "$OLLAMA_HOST/api/embeddings" \
    -d "{\"model\": \"$EMBED_MODEL\", \"prompt\": \"$text\"}")
  
  if [[ -z "$response" ]]; then

Ssd 3

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script aggregates broad workspace and global memory content—including configs, recent notes, TODOs, decisions, boss preferences, and team member data—without sensitivity classification or scope restriction. In the context of an autoload mechanism intended to feed an agent, this greatly increases the risk of prompt-context poisoning, privacy leakage, and unintended disclosure of confidential operational information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly advertises automatic saving of Feishu group chat sessions but provides no privacy notice, consent guidance, retention limits, or warning that chat content may include sensitive third-party data. In an agent skill, this creates a real risk of collecting and persisting conversations beyond user expectations, especially in shared group-chat contexts.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill promotes automatic saving of session content across conversations and Feishu group chats, plus cross-agent sharing via a global workspace. That combination materially increases the chance that sensitive prompts, credentials, internal discussions, or personal data are retained and exposed beyond the original conversation scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill documents automatic degradation/forgetting of memories via scheduled processing and LLM compression without warning that the process may be irreversible or lossy. Users could unintentionally lose important operational or audit-relevant information if automated demotion, compression, or forgetting runs without backup or confirmation.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

每天凌晨 3 点自动执行记忆降级:

bash
# crontab -e
0 3 * * ~/.openclaw/workspace/agents/maozhuli/cat-viking-memory/memory-pipeline/memory-tier-cron.sh

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · 使用教程.md (reported line 99)May include surrounding context.

每天凌晨 3 点自动执行记忆降级:

bash
# crontab -e
0 3 * * ~/.openclaw/workspace/agents/maozhuli/cat-viking-memory/memory-pipeline/memory-tier-cron.sh

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented flow stores session content automatically at conversation end through a hook, with no clear minimization, filtering, or review step. This makes it easy to capture all user inputs wholesale, including secrets or regulated data, and persist them into the memory system unintentionally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly enables automatic memory saving and describes optional Feishu session capture, but it does not provide a clear privacy warning, consent flow, retention policy, or guidance about sensitive-data handling. In a memory-management skill, silent or poorly disclosed persistence increases the risk of collecting conversations, credentials, or personal data without informed user awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The entire skill description, examples, labels, and trigger keywords are presented only in Chinese, with no indication of language choice or opt-in. For a generally applicable skill, this creates an implicit locale/language constraint that is not documented as optional or justified as region-specific.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill includes automatic memory capture via keyword triggers, monitor mode, and session-end hooks that direct the agent to retain broad conversation or session content in long-term memory. Because the capture scope is not tightly bounded and no strong secret-handling controls are described, sensitive user inputs, credentials, internal discussions, or personal data may be silently persisted and later exposed through retrieval or indexing.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The auto-save trigger keywords are broad action verbs that commonly appear in normal user conversations, making unintended persistence likely. In a memory pipeline that writes to long-term storage automatically, this can capture user content without meaningful consent or context filtering, including sensitive operational or personal details.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file claims a 'three-layer trigger filtering' design, but the implemented save path stores content whenever the save entrypoint is invoked, with only deduplication and an importance flag affecting handling. This mismatch can cause operators or upstream agents to assume stronger filtering than actually exists, leading to unintended persistence of user data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
71% confidence
Finding

The script's natural-language descriptions and user-facing messages are entirely in Chinese, with no indication that language is configurable or chosen by the user. This can violate a language/locale policy when a skill imposes a specific language without opt-in.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The explicit marker logic is broad enough to treat phrases like 'remember this password' as valid save triggers, encouraging storage of secrets based on natural-language cues alone. In the context of a memory pipeline, this is dangerous because it normalizes persistent retention of credentials and other highly sensitive material without sensitivity checks.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

When content lacks an explicit marker, the script still labels it low importance and saves it to hot storage, meaning ordinary session summaries are retained by default. This creates unnecessary data retention and increases exposure of personal or confidential information in routine conversations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script writes user-provided summaries into persistent memory storage without any warning, confirmation, or consent check at the point of storage. In a memory skill, this increases the risk of silently retaining personal, sensitive, or regulated information that the user did not expect to persist.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.