Back to skill

Security audit

NoMoreForget

Security checks for vulnerabilities and agentic risk

Overview

This memory-management skill is mostly coherent, but its restore tooling has unsafe command handling and can overwrite persistent OpenClaw memory files.

Review before installing. Run the scripts only from a trusted local copy, avoid restore_memory.sh until its input validation is fixed, and understand that enabling Memory Flush causes selected conversation details to be saved under OpenClaw memory files across sessions. Back up ~/.openclaw before running install or restore.

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

Warning
Location
scripts/restore_memory.sh:35
Finding

Command Injection Through Unvalidated Restore Selection

Content
View full analysis
/dev/null | sed -n "${choice}p") ``` ### Technical Analysis The script requests a numeric backup selection but does not verify that `choice` contains only an integer from 1 through 10. Instead, it directly interpolates the value into a GNU `sed` program: ```bash sed -n "${choice}p" ``` This is not ordinary argument injection; the user-controlled value becomes executable `sed` syntax. GNU `sed` supports commands such as `e`, which can invoke a shell command. An input containing a valid address followed by an injected `e` command can therefore cause command execution while `sed` evaluates the generated program. Shell quoting around `"${choice}p"` does not prevent this vulnerability. It prevents shell word splitting, but it does not prevent `sed` from interpreting the content as program instructions. ### Attack Path 1. An attacker convinces a user to run `scripts/restore_memory.sh`, or otherwise controls the value entered at the backup-selection prompt. 2. Instead of entering a number from 1 through 10, the attacker supplies a crafted GNU `sed` expression containing the `e` command. 3. The script appends `p` and passes the resulting attacker-controlled program to `sed -n`. 4. GNU `sed` evaluates the injected command and invokes a shell command. 5. The command runs with the same operating-system privileges and environment as the user running the restore script. 6. Subsequent backup-path validation may fail, but it occurs only after the injected command has already executed. ### Impact Assessment Successful exploitation permits arbitrary local command execution ...[truncated 418 chars]
Remediation
View remediation
${#backups[@]} )); then echo "Invalid selection" exit 1 fi SELECTED_BACKUP=${backups[choice-1]} ``` At minimum, enforce `^([1-9]|10)$` before the existing `sed` call. Using a Bash array is preferable because it eliminates dynamic `sed` syntax entirely. The selected path should also be canonicalized and verified to remain beneath `$BACKUP_BASE` before any restore or deletion operation. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/backup_memory.sh:43
Finding

Unsafe Filename Splitting in Backup Cleanup and Log Archiving

Content
View full analysis
/dev/null | wc -l) if [ $BACKUP_COUNT -gt 10 ]; then echo "" echo "🧹 清理旧备份..." ls -1dt "$BACKUP_BASE"/backup_* | tail -n +11 | xargs rm -rf echo " 已保留最近 10 个备份" fi ``` From `scripts/optimize_memory.sh`: ```bash OLD_LOGS=$(find "$MEMORY_DIR" -maxdepth 1 -name "*.md" -mtime +30 2>/dev/null) if [ -n "$OLD_LOGS" ]; then OLD_COUNT=$(echo "$OLD_LOGS" | wc -l) echo "发现 $OLD_COUNT 个超过 30 天的日志文件" read -p "是否归档这些日志?(y/N) " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]]; then mkdir -p "$ARCHIVE_DIR" for log in $OLD_LOGS; do mv "$log" "$ARCHIVE_DIR/" done fi fi ``` ### Technical Analysis Both implementations serialize pathnames as newline-delimited text and later reconstruct arguments through whitespace parsing. In the backup script, `xargs` uses spaces, tabs, and newlines as separators by default. A backup directory whose name contains one of those characters can therefore become multiple arguments to `rm -rf`. In the optimization script, command substitution removes trailing newlines, and `for log in $OLD_LOGS` performs shell word splitting and pathname expansion. A daily-log filename containing whitespace, wildcard characters, or embedded newlines will not be handled as one pathname. Unix filenames may legally contain spaces, tabs, newlines, wildcard characters, and leading hyphens. Consequently, line-oriented `ls`, command substitution, and default `xargs` parsing are not safe mechanisms for passing filenames to destructive commands. The immediate risk is constrained because these paths are inside the current user's OpenClaw directories. N ...[truncated 1421 chars]
Remediation
View remediation
10 )); then for backup in "${backups[@]:10}"; do rm -rf -- "$backup" done fi ``` For log archiving, process null-delimited `find` results directly: ```bash mkdir -p -- "$ARCHIVE_DIR" while IFS= read -r -d '' log; do mv -- "$log" "$ARCHIVE_DIR/" done < <( find "$MEMORY_DIR" -maxdepth 1 -type f \ -name '*.md' -mtime +30 -print0 ) ``` Additional hardening should include: - Use `--` before pathname operands accepted by `rm`, `mv`, and similar utilities. - Confirm that each deletion target is a canonical child of `$BACKUP_BASE`. - Avoid recursive forced deletion where a narrower operation is sufficient. - Create backup directories with restrictive permissions. - Log the exact canonical targets before deletion. - Consider requiring confirmation before removing old backups. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (25)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

This finding indicates the skill claims to enable Memory Flush, optimize config, and diagnose issues, while the relevant code path only restores from existing backups and lists files. Such misleading recovery tooling is risky because a user may rely on it during an incident and inadvertently overwrite state or assume protections exist when they do not.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

This finding indicates the skill claims to enable Memory Flush, optimize config, and diagnose issues, while the relevant code path only restores from existing backups and lists files. Such misleading recovery tooling is risky because a user may rely on it during an incident and inadvertently overwrite state or assume protections exist when they do not.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

This finding indicates the skill claims to enable Memory Flush, optimize config, and diagnose issues, while the relevant code path only restores from existing backups and lists files. Such misleading recovery tooling is risky because a user may rely on it during an incident and inadvertently overwrite state or assume protections exist when they do not.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
83% confidence
Finding

The cleanup pipeline uses ls ... | tail ... | xargs rm -rf, which is unsafe because pathnames are parsed through whitespace-delimited text processing and then passed to a destructive command. If an attacker can create crafted backup directory names or influence the backup base contents, this can cause unintended deletions; the use of rm -rf amplifies the risk.

Content

Scanner excerpt · scripts/backup_memory.sh (reported line 48)May include surrounding context.

sh
if [ $BACKUP_COUNT -gt 10 ]; then
    echo ""
    echo "🧹 清理旧备份..."
    ls -1dt "$BACKUP_BASE"/backup_* | tail -n +11 | xargs rm -rf
    echo "   已保留最近 10 个备份"
fi

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The script recursively deletes "$WORKSPACE_DIR/memory" before restoring backup contents, with no validation that WORKSPACE_DIR is the expected application directory and no integrity checks on the selected backup. If the workspace path is misconfigured, symlinked, or backup contents are malicious/tampered, this can destroy data or restore attacker-controlled state into the agent's memory files.

Content

Scanner excerpt · scripts/restore_memory.sh (reported line 74)May include surrounding context.

sh
# 恢复 memory 目录
if [ -d "$SELECTED_BACKUP/memory" ]; then
    rm -rf "$WORKSPACE_DIR/memory"
    cp -r "$SELECTED_BACKUP/memory" "$WORKSPACE_DIR/"
    echo "✅ 已恢复 memory 目录"
fi

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README instructs users to run scripts that optimize, back up, and restore memory files, which inherently operate on persistent user data, but it does not warn that these actions may modify, overwrite, or expose that data. In an agent-skill context, memory files can contain sensitive prompts, history, constraints, or credentials, so undocumented mutation and recovery operations increase the risk of accidental data loss or unintended disclosure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill advertises and instructs execution of scripts that read and write user configuration and memory files, but it does not declare any explicit tool scope or permissions. In a skill ecosystem, missing scope disclosure reduces user visibility into what the skill can modify and increases the chance of unintended or unsafe file operations being trusted and executed.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger list contains broad phrases related to memory and token usage that can match ordinary conversation, increasing the chance the skill activates in contexts where the user did not intend file or configuration changes. In an automation setting, overly broad invocation conditions can lead to accidental execution of maintenance or destructive operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill tells users to run install and maintenance scripts that modify configuration and memory-related files, but it does not provide an explicit warning about those changes, backups, or rollback steps. This creates a real safety risk because users may execute commands affecting persistent state without informed consent or preparation for recovery.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document states that daily logs are automatically written and contain session details, but it does not clearly disclose to end users that their conversation content will be persisted to disk. In a memory-management skill, this omission is security-relevant because users may reveal sensitive data while assuming the interaction is ephemeral, creating privacy and data-retention risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The memory flush flow instructs the agent to 'capture durable memories to disk' and use a dated memory file, but it does not include an explicit disclosure that model-selected conversation content will be persisted beyond the current session. This is dangerous because automatic summarization and persistence can store sensitive, regulated, or unintended data without the user's informed awareness, especially in a skill whose purpose is to increase retention.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The document recommends cloud-based memory plugins such as MemOS Cloud and Mem0, including cross-instance sharing and hosted memory, without clearly warning that user prompts, conversation history, or sensitive project data may be transmitted to third-party services. In the context of a memory-fix skill, users are especially likely to route large amounts of retained context into these systems, increasing the chance of unintended data disclosure or compliance violations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

该 markdown 文件从标题开始即完全以中文呈现,未见提供多语言选项、用户选择机制,或说明这是面向特定中文区域/团队的限定文档。根据语言/区域政策要求,未经用户选择而强制特定语言属于自然语言策略违规。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script removes backup directories with rm -rf as part of its retention cleanup, which is a destructive operation. Although it prints a cleanup message, there is no prior warning, confirmation prompt, or comment/docstring clearly disclosing to the user that older backups will be permanently deleted.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script's natural-language interface is entirely in Chinese, including comments, status messages, and remediation guidance. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This shell script backs up files, creates new directories and files, and overwrites ~/.openclaw/openclaw.json with merged settings. Although it logs what it is doing, it does not clearly warn the user up front that running the installer will modify persistent configuration and workspace data under ~/.openclaw.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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 · scripts/install.sh (reported line 28)May include surrounding context.

sh
BACKUP_DIR="$OPENCLAW_DIR/backup_$(date +%Y%m%d_%H%M%S)"
echo ""
echo "📦 备份现有配置到: $BACKUP_DIR"
mkdir -p "$BACKUP_DIR"

if [ -f "$OPENCLAW_DIR/openclaw.json" ]; then
    cp "$OPENCLAW_DIR/openclaw.json" "$BACKUP_DIR/"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script's comments, prompts, and status messages are presented entirely in Chinese, including user-facing confirmation text. This creates a language/locale restriction for users without any opt-in or documented region-specific justification, which matches the policy-violation category for forced language constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script’s natural-language interface is consistently presented in Chinese, including status messages, guidance, and comments. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is explicitly documented and justified, 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
94% confidence
Finding

The natural-language documentation is presented in Chinese throughout the README, and there is no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking audience. This can violate language or locale policy when a skill forces a specific 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
76% confidence
Finding

The manifest description and heading present the skill entirely in Chinese and do not indicate that users may choose another language. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy issue unless the locale limitation is explicit and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown template uses Chinese headings and instructional text throughout, such as the title and section labels, without offering any language choice or documenting that the template is intended only for a Chinese-language context. That can violate a language/locale policy when skills are expected to avoid forcing a specific 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
98% confidence
Finding

The script's comments and user-visible echo messages are in Chinese throughout, with no indication that the skill is region-specific or that users can select another language. This can violate a language/locale policy when a specific language is imposed without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The installer's comments and all user-visible echo/print messages are in Chinese, which imposes a specific language on all users. There is no opt-in, fallback, or indication that the skill is intended only for a Chinese-speaking or region-specific audience.

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 all interactive output strings are in Chinese, which imposes a specific language on users with no opt-in or fallback. The policy explicitly calls out language or locale constraints as violations when the skill does not offer user choice or clearly justify the restriction.

Content

No source excerpt is available for this finding.