Back to skill

Security audit

yf-memo

Security checks for vulnerabilities and agentic risk

Overview

This memo skill mostly matches its stated purpose, but it includes a test script that can erase existing memo data and guidance that can add persistent scheduled/local script execution.

Review before installing. Do not run references/test-cross-platform.sh against a real OpenClaw workspace unless you have backups. Keep the skill in a trusted install path, avoid ambiguous duplicate yf-memo directories, and only enable hooks, shell-profile changes, symlinks, or cron summaries if you explicitly want persistent local execution.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
references/test-cross-platform.sh:8
Finding
Cross-platform test script permanently deletes existing user memo data<![CDATA[ ## Vulnerability Details **File Location**: `references/test-cross-platform.sh:8-9` and `references/test-cross-platform.sh:85-86` **Vulnerability Type**: Destructive testing against production workspace files **Risk Level**: High ### Vulnerable Code ```bash # Clean up previous tests rm -f ~/.openclaw/workspace/pending-items.md 2>/dev/null rm -f ~/.openclaw/workspace/completed-items.md 2>/dev/null ``` The files are deleted again during final cleanup: ```bash rm -f ~/.openclaw/workspace/pending-items.md 2>/dev/null rm -f ~/.openclaw/workspace/completed-items.md 2>/dev/null ``` The script then writes generic empty templates instead of restoring the user's original files: ```bash echo "Restoring original files..." cat > ~/.openclaw/workspace/pending-items.md << 'EOF' # 📝 Pending Items _Last updated: 2026-03-15 10:00 ## Pending items _No pending items_ ... EOF cat > ~/.openclaw/workspace/completed-items.md << 'EOF' # ✅ Completed Items _Created at: 2026-03-15 00:19_ ... _No completed items yet_ ... EOF ``` ### Technical Analysis The test script performs destructive operations directly against the normal OpenClaw workspace rather than an isolated test directory. It unconditionally removes the user's pending and completed memo files without confirmation, backup creation, or a recovery mechanism. Although the script claims to restore the original files, it only creates predefined empty templates. Existing tasks, completion history, timestamps, and any manually added content are therefore permanently discarded. The script also lacks a cleanup trap and does not validate whether the target paths are test fixtures. Consequently, normal execution of the supplied test is sufficient to cause data loss; no malformed input is required. ### Attack Path 1. A user or AI agent runs `references/test-cross-platform.sh` to verify compatibility. 2. The script resolves `~/.openclaw/workspace` as the active workspace. 3. Existing `pending-items.md` and `complete ...[truncated 887 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Run tests in an isolated temporary directory created with `mktemp -d`. - Make `TODO_FILE` and `DONE_FILE` configurable through environment variables or command-line arguments. - Never default a test script to production workspace paths. - Add a cleanup trap that removes only the temporary test directory: ```bash TEST_DIR="$(mktemp -d)" trap 'rm -rf -- "$TEST_DIR"' EXIT export TODO_FILE="$TEST_DIR/pending-items.md" export DONE_FILE="$TEST_DIR/completed-items.md" ``` - If testing against an existing workspace is unavoidable, require explicit confirmation and create backups before modifying anything. - Restore backups atomically and verify successful restoration before deleting them. - Reject execution when resolved test paths equal the normal production memo paths unless an explicit, clearly named destructive-test option is supplied. ]]>

T07 · Tool Hijacking and Spoofing

Error
Location
SKILL.md:82
Finding
Unverified dynamic skill discovery can execute a spoofed local script<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:82-84` **Vulnerability Type**: Untrusted local tool discovery and execution **Risk Level**: High ### Vulnerable Code ```bash # Find skill directory by name (yf-memo) SKILL_DIR=$(find ~/.openclaw/skills ~/.openclaw/workspace/skills -name "yf-memo" -type d 2>/dev/null | tail -1) MEMO_SCRIPT="$SKILL_DIR/scripts/memo-helper.sh" sh "$MEMO_SCRIPT" add "task description" ``` Equivalent discovery logic is also recommended in `references/path-resolution.md:17-31` and used by `references/test-cross-platform.sh:13-38`. ### Technical Analysis The documented execution flow searches multiple directory trees for any directory named `yf-memo` and selects a result based solely on `find` traversal order. It does not verify: - The canonical path of the selected directory - Whether the directory or script is a symbolic link - File ownership or writable permissions - Package provenance or integrity - Whether multiple ambiguous matches exist - Whether the selected script belongs to the installed skill package The selected `memo-helper.sh` is then passed directly to `sh`. A spoofed directory containing a replacement script can therefore receive legitimate-looking memo invocations. This issue is exploitable when an attacker, compromised extension, or untrusted local process can create a matching directory under one of the searched roots. Selection differs across examples—some use `head -1` and others use `tail -1`—which further makes the selected script dependent on filesystem traversal order rather than an explicit trust decision. ### Attack Path 1. An attacker or untrusted local package obtains write access to one of the searched skill trees. 2. It creates a directory named `yf-memo` with a malicious `scripts/memo-helper.sh`. 3. The directory is positioned so that `head -1` or `tail -1`, depending on the documented invocation, selects the spoofed path. 4. The user asks the agent to add, list, or complete a memo ...[truncated 1012 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Use a platform-provided, authoritative skill installation path rather than searching all possible roots. - Resolve the selected path canonically with `realpath` and verify that it remains beneath the expected trusted root. - Reject symbolic links for the skill directory and executable script unless they are explicitly part of a trusted installation model. - Verify that the selected directory and script are owned by the expected user and are not writable by group or other users. - Detect multiple matching directories and fail closed instead of choosing one through traversal order. - Verify the script against a package manifest, signature, or trusted cryptographic checksum before execution. - Prefer direct execution of the known packaged entry point rather than invoking an arbitrary discovered file through `sh`. - If dynamic lookup remains necessary, apply checks such as: ```bash TRUSTED_ROOT="$(realpath "$HOME/.openclaw/skills")" SKILL_DIR="$(realpath "$TRUSTED_ROOT/yf-memo")" MEMO_SCRIPT="$SKILL_DIR/scripts/memo-helper.sh" case "$SKILL_DIR/" in "$TRUSTED_ROOT/"*) ;; *) echo "Untrusted skill path" >&2; exit 1 ;; esac [ -f "$MEMO_SCRIPT" ] || exit 1 [ ! -L "$MEMO_SCRIPT" ] || exit 1 ``` - Ensure every guide and test uses the same validated resolution implementation rather than duplicating inconsistent `head -1` and `tail -1` logic. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (31)

Harmful Content Injection

Critical
Category
Prompt Injection
Content
steps:
          - "Place the entire yf-memo directory into ~/.openclaw/skills/"
          - "Ensure scripts are executable: chmod +x scripts/*.sh"
---

# 🗂️ Personal Memo System Skill

A personal task tracking system integrated with OpenClaw workspace. The AI assistant uses this skill when it recognizes the user wants to manage tasks, reminders, or to-dos through natural conversation.

## Core Principle: Intent-Based Activation
Confidence
95% confidence
Finding
This content may contain harmful instructions that could cause physical harm if followed. CRITICAL: Review carefully before use.

Vague Triggers

High
Confidence
97% confidence
Finding
The skill is described as activating whenever the assistant detects generic user intent around remembering, tracking, or managing tasks. That scope is broad enough to trigger on ordinary conversation and can cause unintended tool use or storage of user data without sufficiently explicit invocation boundaries.

Vague Triggers

High
Confidence
95% confidence
Finding
The skill explicitly rejects fixed triggers but does not replace them with precise eligibility rules, instead relying on broad intent inference. This increases the chance of accidental activation, misclassification of user speech, and unintended execution of task-management scripts in ambiguous contexts.

Context-Inappropriate Capability

High
Confidence
95% confidence
Finding
This setup flow modifies cron to run commands automatically on a schedule, establishing persistence and unattended execution. In the context of a memo skill, that is disproportionately powerful because it can execute shell commands in the user's workspace long after the original interaction, making abuse or later script tampering more impactful.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
echo "======================================"

# 清理之前的测试
rm -f ~/.openclaw/workspace/pending-items.md 2>/dev/null
rm -f ~/.openclaw/workspace/completed-items.md 2>/dev/null

# 1. 测试技能目录查找
Confidence
98% confidence
Finding
This direct rm -f command deletes a user workspace file with no confirmation, sandboxing, or backup. In the context of a memo-management skill, that file is likely valuable user data, so the command is a concrete destructive operation rather than a harmless test primitive.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
# 清理之前的测试
rm -f ~/.openclaw/workspace/pending-items.md 2>/dev/null
rm -f ~/.openclaw/workspace/completed-items.md 2>/dev/null

# 1. 测试技能目录查找
echo "🔍 1. 查找技能目录..."
Confidence
98% confidence
Finding
This command removes the completed-items workspace file without any guardrails. That creates immediate risk of permanent loss of user history and demonstrates unsafe handling of tool parameters against live user data.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
# 8. 清理测试数据
echo "🔍 8. 清理测试环境..."
sh "$MEMO_SCRIPT" complete-number 2 2>/dev/null
rm -f ~/.openclaw/workspace/pending-items.md 2>/dev/null
rm -f ~/.openclaw/workspace/completed-items.md 2>/dev/null
echo "恢复原始文件..."
cat > ~/.openclaw/workspace/pending-items.md << 'EOF'
Confidence
98% confidence
Finding
This second cleanup deletion again targets the live pending-items file in the user's workspace. Repeated destructive file removal increases the chance of data loss and shows the script is designed to modify real user state during testing.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
echo "🔍 8. 清理测试环境..."
sh "$MEMO_SCRIPT" complete-number 2 2>/dev/null
rm -f ~/.openclaw/workspace/pending-items.md 2>/dev/null
rm -f ~/.openclaw/workspace/completed-items.md 2>/dev/null
echo "恢复原始文件..."
cat > ~/.openclaw/workspace/pending-items.md << 'EOF'
# 📝 Pending Items
Confidence
98% confidence
Finding
This cleanup command deletes the live completed-items file before recreating it with canned content. That is dangerous because it irreversibly replaces personal completion history and can be abused or accidentally triggered to wipe data.

Self-Modification

High
Category
Rogue Agent
Content
The system is designed to be flexible. Want to customize?

1. **Change response format** - Edit SKILL.md tone guidelines
2. **Add new features** - Modify memo-helper.sh
3. **Integrate with other services** - Add API calls to scripts
4. **Change file locations** - Update script paths
Confidence
90% confidence
Finding
The guide explicitly instructs users to edit SKILL.md, modify scripts, add API calls, and change paths. Encouraging self-modification of skill logic and configuration weakens trust boundaries and can lead operators to introduce unsafe code paths, expanded permissions, or persistence changes without review. In an agent skill context, this is dangerous because the documentation normalizes altering operational behavior beyond the original audited scope.

Session Persistence

Medium
Category
Rogue Agent
Content
**Method 3: Use Environment Variable Setup**
First, set up these environment variables in shell profile:
```bash
# Add to .zshrc or .bashrc
export YFMEMO_SKILL_DIR="$HOME/.openclaw/skills/yf-memo"
export YFMEMO_SCRIPT="$YFMEMO_SKILL_DIR/scripts/memo-helper.sh"
```
Confidence
90% 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.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The hook documentation explicitly includes scheduled execution via cron, which expands a simple memo/todo skill into persistent autonomous behavior. While a daily summary is plausibly related to task management, adding scheduled execution at session setup increases attack surface and can normalize background execution beyond the user's immediate request.

Session Persistence

Medium
Category
Rogue Agent
Content
```bash
# Copy hook to OpenClaw hooks directory
mkdir -p ~/.openclaw/hooks/yf-memo
cp -r hooks/openclaw/* ~/.openclaw/hooks/yf-memo/
```
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.

Context-Inappropriate Capability

Medium
Confidence
89% confidence
Finding
The hook installs executable shell scripts into the user's workspace automatically, creating persistent code artifacts that may later be run with user trust. For a memo skill, this is broader than necessary and dangerous because it introduces local executables without strong justification, review, or integrity controls.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The documented auto-setup behavior allows silent activation when files are missing, which weakens user awareness and consent for file creation and environment changes. Silent setup is risky in hooks because it can normalize unexpected side effects at session start without a clear user action.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill description permits file creation and script installation without a clear warning, reducing informed consent for persistent local changes. In a startup hook, this is dangerous because users may not expect automatic writes or executable deployment from a memo-management feature.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The post-setup message uses Chinese content in commands and examples such as 'Reminder: <内容>' and 'testmemo reminder系统' without offering a language choice. This creates a locale/language policy issue because the skill appears to assume a specific language rather than letting the user opt in.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The documented architecture explicitly routes user input through 'Script Execution', and later examples repeatedly invoke shell commands via exec_command. For a personal memo/todo skill, maintaining local files is expected, but exposing a general command-execution pattern is a broader capability not justified by the stated purpose alone.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The guide explicitly describes script execution and file updates, but provides no warning that using the skill will modify files under the user's local workspace. Without clear disclosure and consent expectations, users may trigger local state changes they did not realize would occur.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The extension section documents forwarding memo content into Apple Notes, Calendar, and Reminders, which expands the skill from local memo storage into other apps and data domains. This broadens the attack surface and can cause unintended persistence or disclosure of user data, especially because the examples again interpolate raw content into command strings.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The Apple Notes, Calendar, and Reminders examples describe sending user-provided memo content into external applications without warning about additional storage locations, synchronization, or privacy implications. Users may assume data stays in the memo skill when it is actually propagated elsewhere.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
This markdown file uses Chinese throughout its title, instructions, and examples, which can amount to a language/locale policy violation when the skill documentation forces a specific language without user opt-in. There is no indication that the skill is intentionally region-specific or that alternative language support is available.

Session Persistence

Medium
Category
Rogue Agent
Content
```bash
# 安装脚本中创建符号链接
mkdir -p ~/.local/bin
ln -sf "$(pwd)/scripts/memo-helper.sh" ~/.local/bin/yf-memo-helper
ln -sf "$(pwd)/scripts/daily-summary.sh" ~/.local/bin/yf-memo-daily
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.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script deletes user workspace memo files at startup without prompting, backup, or verifying they are test-only artifacts. In a personal memo skill, those files are likely to contain real user data, so destructive cleanup in a test script creates a real risk of data loss.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The script overwrites workspace markdown files with hardcoded content, destroying any existing notes or completed-item history. Because this skill manages personal reminders and todos, replacing user state with canned text is a genuine integrity and availability issue.

Session Persistence

Medium
Category
Rogue Agent
Content
- Basic terminal access (for cron setup if desired)

### First Time Setup
1. The Skill will automatically create required files:
   - `pending-items.md` - For pending todos (automatically created with template)
   - `completed-items.md` - For completed items (automatically created)
Confidence
83% confidence
Finding
The guide states that the skill automatically creates persistent files for pending and completed items. Persistence itself is expected for a memo tool, but automatic creation and storage of user-entered data creates a lasting state surface that can retain sensitive information, especially if location, retention, and access controls are not clearly documented. In this skill context the behavior is functional, but still security-relevant because it stores potentially private task data on disk.

Static analysis

No suspicious patterns detected.