Back to skill

Security audit

🦞 龙虾记忆备份同步技能 / Lobster Memory Backup & Sync

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent memory backup tool, but it can automatically push sensitive memory files to a Git remote without reliable user confirmation.

Install only if you are comfortable with conversation memory, profile files, and workflow notes being committed to a user-configured Git remote. Use a private repository, a dedicated least-privilege SSH key, review diffs before every push, avoid cron until the script fails closed without approval, and do not rely on the built-in secret scanner as complete protection.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/memory-backup.sh:29
Finding

Shell Command Injection Through GIT_SSH_COMMAND

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/memory-backup.sh:70
Finding

Non-Interactive Execution Bypasses Push Confirmation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/memory-sync.sh:41
Finding

Incomplete Secret Detection Allows Credentials to Be Backed Up

Content
View full analysis
/dev/null; then echo "[memory-sync] Refused: file contains sensitive content pattern (${pattern})" echo "[memory-sync] Check the file and remove sensitive information before retrying" exit 1 fi done ``` ```bash # scripts/memory-backup.sh TRACKED_PATHS=( "MEMORY.md" "memory" "SOUL.md" "USER.md" "IDENTITY.md" "HEARTBEAT.md" ) for path in "${TRACKED_PATHS[@]}"; do if [ -e "$path" ]; then git add -A "$path" fi done ``` ### Technical Analysis The content scanner recognizes only a small set of private-key markers, AWS field names, and one narrowly formatted password assignment. It does not reliably detect many common secret forms, including: - Bearer tokens and session tokens - GitHub, GitLab, Slack, messaging, or cloud-provider tokens - Database connection strings containing credentials - Cookies and session identifiers - Passwords written in Markdown or formats other than the specific assignment expression - Client secrets, webhook secrets, recovery codes, or private data without recognizable labels - Encoded or multiline credentials More importantly, `memory-backup.sh` does not run this scanner against the actual staged Git content. A user or Agent can invoke the backup script directly, and all files under `memory/` plus several root-level profile files are staged without content inspection. Filename exclusions in `.gitignore` do not p ...[truncated 1230 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/memory-sync.sh:22
Finding

Symbolic-Link Bypass Permits Reading Files Outside the Workspace

Content
View full analysis
" echo "Example: bash scripts/memory-sync.sh /tmp/my-notes.md" exit 1 fi # Reject absolute paths if [[ "$INPUT_FILE" == /* ]]; then echo "[memory-sync] Refused: absolute paths are not allowed" exit 1 fi # Reject directory traversal if [[ "$INPUT_FILE" == *..* ]]; then echo "[memory-sync] Refused: path cannot contain .." exit 1 fi ``` ```bash { echo "# Automatically Synchronized Memory" echo echo "- Source file: ${INPUT_FILE}" echo "- Synchronization time: ${STAMP}" echo echo "## Original Content" echo cat "$INPUT_FILE" } > "$TARGET" ``` ### Technical Analysis The script validates only the textual form of the supplied path. A relative path without `..` passes the checks even if it is a symbolic link resolving to an absolute file outside `WORKDIR`. The `-f` test follows symbolic links, and the later `cat` operation also follows them. The script never resolves the canonical path, verifies containment under the workspace, or rejects symbolic links. Therefore, its stated protection against reading `/etc`, `/root`, and other external paths is incomplete. The copied content is written beneath `memory/channels/custom/`, after which `memory-backup.sh` is invoked automatically. This connects a local-file read primitive to a remote Git upload path. ### Attack Path 1. An attacker or compromised process with write access to the workspace creates a relative symlink, such as `notes.md`, pointing to a sensitive file readable by the Skill account. 2. The attacker causes the Agent or user to run `bash scripts/memory-sync.sh notes.md`. 3. The argument is relative, c ...[truncated 931 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/memory-backup.sh:29
Finding

General-Purpose SSH Private Key Is Used as the Default Backup Identity

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

声明描述的是一个较完整的“记忆管理与同步”技能,包含写入、同步、备份、恢复和对话触发等能力。但提供的代码只是单一的 Git 备份脚本:追踪固定路径,提交并推送到 Git 远程仓库。虽然其中“通过 Git 推送到远程仓库备份”这一点与声明部分一致,但其余核心能力并未在代码中体现。代码也没有解析对话内容、自动写入记忆、恢复文件、或任何跨渠道接口/同步实现。因此描述明显宽于实际行为,存在实质性不匹配。

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The description does not prominently warn that conversation content may be synchronized across channels and pushed to a remote Git repository, which is a significant data handling and exfiltration concern. Users may invoke the skill for local memory persistence without realizing the content could be replicated and transmitted off-host, including potentially sensitive cross-channel context.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The workflow includes a raw rm command using a templated path, which is dangerous because the substituted name may be wrong, ambiguous, or attacker-influenced, leading to unintended deletion. In a memory backup skill, file operations are part of the core behavior, so unsafe deletion guidance is more dangerous than in passive documentation because an agent or user may execute it during routine maintenance.

Content

Scanner excerpt · references/workflows.md (reported line 52)May include surrounding context.

md
ls docs/<名称>-workflow.md 2>/dev/null && echo "旧版存在,需删除"

# 3. 确认新版内容已包含旧版所有有价值信息后,删除旧版
rm memory/<名称>-workflow.md
rm docs/<名称>-workflow.md

# 4. 推送备份

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

This second rm command targets the docs path and has the same tool-parameter abuse risk: a templated filename can cause deletion of the wrong document or removal of legitimate files during migration. Because the skill promotes automatic backup/sync workflows, destructive commands embedded in the process can propagate operational mistakes and cause irreversible loss of documentation.

Content

Scanner excerpt · references/workflows.md (reported line 53)May include surrounding context.

md
# 3. 确认新版内容已包含旧版所有有价值信息后,删除旧版
rm memory/<名称>-workflow.md
rm docs/<名称>-workflow.md

# 4. 推送备份
bash scripts/memory-backup.sh

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/memory-backup.sh (reported line 30)May include surrounding context.

sh
GIT_REMOTE="${GIT_REMOTE:-}"

# TODO: 替换为你的 SSH 私钥路径
MEMORY_BACKUP_KEY="${MEMORY_BACKUP_KEY:-~/.ssh/id_rsa}"

# ---- 配置校验 ----
if [ -z "$GIT_REMOTE" ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/memory-backup.sh (reported line 40)May include surrounding context.

sh
fi

# ---- SSH 配置(安全模式)----
KNOWN_HOSTS="${HOME}/.ssh/known_hosts"
export GIT_SSH_COMMAND="ssh -i ${MEMORY_BACKUP_KEY} -o IdentitiesOnly=yes -o UserKnownHostsFile=${KNOWN_HOSTS}"

# ---- 确保 git remote 已配置 ----

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
exit 1
fi

# 拒绝目录遍历(防止 ../etc/passwd 这类路径)
if [[ "$INPUT_FILE" == *..* ]]; then
  echo "[memory-sync] 拒绝:路径不能包含 .. (目录遍历)"
  exit 1

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/memory-sync.sh (reported line 37)May include surrounding context.

sh
exit 1
fi

# 拒绝目录遍历(防止 ../etc/passwd 这类路径)
if [[ "$INPUT_FILE" == *..* ]]; then
  echo "[memory-sync] 拒绝:路径不能包含 .. (目录遍历)"
  exit 1

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Allowing the skill to 'proactively' persist memory after 'important conversations' creates an ambiguous, agent-defined activation boundary for a data-exporting workflow. Because the skill stores conversation data and can push it to Git, vague autonomous triggering materially increases the risk of silent collection, retention, and remote disclosure without informed user approval.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Allowing the skill to 'proactively' persist memory after 'important conversations' creates an ambiguous, agent-defined activation boundary for a data-exporting workflow. Because the skill stores conversation data and can push it to Git, vague autonomous triggering materially increases the risk of silent collection, retention, and remote disclosure without informed user approval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document explicitly states that core memory files are automatically backed up to a remote Git repository every day, but it does not require informed user consent, destination transparency, or a warning about privacy consequences. In the context of a memory backup skill that stores conversation-derived notes, this can lead to unintentional exfiltration of personal, project, or sensitive contextual data to external infrastructure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This guide operationalizes automatic backup of conversation-derived memory files to a remote Git repository, but its warning only mentions API keys and passwords. In this skill's context, the memory store is likely to contain personal data, confidential workflow notes, and cross-channel conversation content, so encouraging routine remote sync without strong data-classification, minimization, or encryption guidance creates a real privacy and data-exfiltration risk.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

The cron-based scheduled backup creates persistent, unattended exfiltration of memory contents to a remote repository. In the context of a memory-backup skill, this increases risk because newly stored sensitive conversation content may be pushed automatically without human review, and the log redirection may also leave traces of backup activity or errors on disk.

Content

Scanner excerpt · references/setup-guide.md (reported line 77)May include surrounding context.

bash
# 编辑 crontab
crontab -e

# 每天早上 9 点自动备份
0 9 * * * cd /root/.openclaw/workspace && bash scripts/memory-backup.sh >> /root/.openclaw/logs/backup.log 2>&1

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document instructs operators to run destructive rm commands as part of a normal backup workflow, but it lacks explicit safety warnings, path validation steps, or safer alternatives. In an agent skill that may operationalize shell instructions, this creates a realistic risk of accidental data loss if filenames are mistyped, expanded unexpectedly, or applied to the wrong file.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The recovery phrase "从备份继续" is broad and can trigger loading and acting on backed-up workflow content without clear confirmation, scope checks, or exclusions. In a memory/backup skill, that increases the chance of unintended restoration of stale, sensitive, or adversarially planted instructions across conversations and channels.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The header comments, usage text, and operational messages are written only in Chinese, which imposes a specific language/locale on users. Under the policy, locale constraints should either offer user choice or be clearly documented as justified for a region-specific tool, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

SQP-3 applies to all file types and includes language or locale policy violations. This setup guide is entirely Chinese and does not indicate that other languages are supported or that Chinese is a justified region-specific requirement, which can be interpreted as forcing a language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file is written as an instruction guide entirely in Chinese and provides a fixed Chinese recovery phrase, but it does not indicate that language selection is optional or limited to a China-specific context. This can constitute a locale-policy issue when a skill effectively forces one language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script's descriptive comments, usage guidance, environment variable explanations, and later user-facing prompts are written only in Chinese. Under the policy, forcing a specific language without offering a choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The inline documentation at L26 presents /tmp/my-notes.md as an example source file, while the enforced validation at L31-L35 rejects all absolute paths. This is an active contradiction between the script's documented usage and its actual behavior, which can mislead operators about what inputs are permitted.

Content

No source excerpt is available for this finding.