Back to skill

Security audit

Claude Code Enhancement

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent multi-agent helper, but its persistent memory and permission controls are too broad and under-scoped for automatic approval.

Review this carefully before installing. It does not show exfiltration or hidden command execution, but you should not use its memory feature for secrets, credentials, private client data, or regulated information, and you should not rely on its permission system as a safety boundary without changing it to deny unknown tools, remove or lock down bypass mode, and require confirmation for persistent memory and agent creation.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T02 · Agent Memory Poisoning

Warning
Location
memory/memory.py:137
Finding

Untrusted Content Can Poison Persistent Agent Memory

Content
View full analysis

Vulnerability Details

File Location: memory/memory.py:137-160, memory/memory.py:165-197; natural-language entry point at nlp_parser.py:109-113 and nlp_parser.py:307-311
Vulnerability Type: Persistent prompt and memory poisoning
Risk Level: Medium

Vulnerable Code

python
def add(self, memory_type: str, content: str, tags: List[str] = None) -> str:
    """添加记忆"""
    entry = MemoryEntry(
        id=str(datetime.now().timestamp()),
        type=memory_type,
        content=content,
        tags=tags or []
    )
    
    # 添加到缓存
    self.entries[memory_type].append(entry)
    
    # 持久化到文件
    self._save_to_file(memory_type, content)
    
    return f"✅ 已添加记忆: [{memory_type}] {content[:50]}..."

def _save_to_file(self, memory_type: str, content: str):
    """保存到分类文件"""
    type_file = self.types_dir[memory_type] / "default.md"
    
    # 追加内容
    with open(type_file, 'a', encoding='utf-8') as f:
        f.write(f"\n- {content}")
    
    # 更新 MEMORY.md
    self._update_memory_entry(memory_type, content)
python
def _update_memory_entry(self, memory_type: str, content: str):
    """更新 MEMORY.md 中的条目"""
    try:
        with open(self.memory_file, 'r', encoding='utf-8') as f:
            lines = f.readlines()
        
        # 找到对应类型的位置
        type_header = f"## {self._get_type_name(memory_type)}"
        start_idx = -1
        end_idx = -1
        
        for i, line in enumerate(lines):
            if type_header in line:
                start_idx = i + 1
            elif start_idx > 0 and line.startswith('## '):
                end_idx = i
                break
        
        if start_idx > 0:
            # 插入新条目
            if end_idx < 0:
                end_idx = len(lines)
            
            # 找到 "-" 开头的行
            insert_idx = start_idx
            for i in range(start_idx, end_idx):
      
...[truncated 3407 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require explicit user confirmation before any natural-language request is committed to persistent memory.
  2. Replace prompt-ready Markdown storage with a structured format containing fields such as content, source, created_at, trust_level, and approved.
  3. Keep stored data separate from system and developer instructions when constructing future Agent prompts. Clearly delimit memory as untrusted reference data.
  4. Reject or quarantine entries containing imperative prompt-control patterns, requests to ignore prior instructions, tool-use directives, credential requests, or role reassignment.
  5. Narrow the natural-language patterns so that only an unambiguous memory command can initiate persistence.
  6. Add provenance and audit logging so users can identify which actor or message created each entry.
  7. Provide review, expiration, and rollback mechanisms for persisted entries.
  8. Apply entry-size and total-memory limits to reduce context flooding and denial-of-service risks.
  9. Add tests proving that unconfirmed or untrusted instructions cannot enter the automatically loaded memory context.

T09 · Insecure Skill Coding Practices

Warning
Location
permission/permission.py:110
Finding

Permission Decisions Fail Open and Support an Unrestricted Bypass Mode

Content
View full analysis

Vulnerability Details

File Location: permission/permission.py:110-176; mode-changing interface at main.py:152-159
Vulnerability Type: Fail-open access-control implementation
Risk Level: Medium

Vulnerable Code

python
def check(self, tool_name: str, input_data: str = "", 
          directory: str = "") -> PermissionResult:
    """检查工具权限"""
    # 绕过模式
    if self.mode == PermissionMode.BYPASS:
        return PermissionResult(
            allowed=True,
            reason="bypass 模式",
            requires_confirmation=False
        )
    
    # 计划模式
    if self.mode == PermissionMode.PLAN:
        return PermissionResult(
            allowed=True,
            reason="plan 模式,仅计划不执行",
            requires_confirmation=False
        )
    
    # 查找匹配的规则
    for rule in self.rules:
        if self._match_tool(rule.tool, tool_name):
            if rule.action == "allow":
                return PermissionResult(
                    allowed=True,
                    reason=f"规则允许: {rule.tool}",
                    requires_confirmation=False
                )
            elif rule.action == "deny":
                return PermissionResult(
                    allowed=False,
                    reason=f"规则拒绝: {rule.tool}",
                    requires_confirmation=False
                )
            else:  # ask
                return PermissionResult(
                    allowed=False,
                    reason="需要用户确认",
                    requires_confirmation=True
                )
    
    # 默认规则:检查工具名称模式
    tool_class = tool_name.split("Tool")[0] if "Tool" in tool_name else tool_name
    
    # 信任的工具
    for pattern in self.trust_patterns:
        if re.search(pattern, tool_name, re.IGNORECASE):
            return PermissionResult(
                allowed=True,
                reason="信任的工具",
                requires_confirmation
...[truncated 4172 chars]
Remediation
View remediation

Remediation Suggestions

  1. Change the unmatched-tool result to deny by default and require an explicit allow rule.
  2. Remove runtime bypass mode from user-accessible interfaces. If it is operationally necessary, restrict it to authenticated administrators and require an explicit, time-limited, out-of-band approval.
  3. Enforce PermissionSystem.check() at the single lowest-level tool dispatch boundary so no Agent, coordinator, plugin, or direct caller can bypass it.
  4. Validate immutable tool identifiers rather than attacker-controlled display names or substring patterns.
  5. Enforce input_pattern, directory, and command_whitelist fields. Canonicalize paths before checking directory boundaries and reject traversal or symlink escapes.
  6. Treat plan mode as non-executable in the dispatcher rather than returning a generally allowed result.
  7. Use explicit rule priority and conflict handling, with deny rules taking precedence over allow rules.
  8. Require confirmation tokens to be bound to a specific tool, normalized arguments, target directory, user, and expiration time.
  9. Audit-log mode changes, decisions, confirmations, and execution results.
  10. Add security tests for unknown tools, aliases, renamed tools, wildcard rules, path traversal, bypass attempts, and direct dispatch paths that omit permission checks.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (25)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

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

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

text

```bash
/task create "实现用户头像上传"
/task status      # 查看当前状态
/task progress    # 查看详细进度
/task complete    # 标记完成

5. 🤖 Enhanced Agent - 增强版 Agent

Agent 类型描述超能力
🧑‍💻 coder编码专家写代码、debug、重构
🔍 reviewer审查专家代码审查、安全扫描
📚 researcher研究专家信息收集、分析整理
👷 worker多面手通用任务执行
🧠 general全能型日常对话任务
python
# 调用专门的 Coding Agent
agent = await spawn_agent(
    type="coder",
    description="修复登录 bug",
    prompt="用户反馈登录后 token 过期时间不对,请检查并修复",
    isolation="worktree"  # 隔离环境,安全!
)

🚀 快速开始

安装

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README promotes 'permanent memory' and storing user preferences without any warning about retention period, sensitivity, consent, or deletion controls. Persistent memory can capture personal data, credentials, or proprietary project details, and users may disclose more than intended if they are told the system will remember information indefinitely.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README suggests that a broad natural-language request can implicitly enable multi-agent mode, which risks unintended activation of powerful orchestration behavior without an explicit user confirmation step. In a skill that can spawn multiple agents, use memory, and invoke tools, ambiguous triggering increases the chance of surprise execution, excess tool use, or unsafe delegation from ordinary user prompts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The memory feature explicitly encourages storing user preferences, feedback, and project context persistently, but provides no warning about retention, sensitivity, or consent. In an agent skill, this can lead users to place personal data, secrets, or sensitive project information into long-lived storage that may later be reused, exposed, or misapplied across tasks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This Python file contains natural-language descriptions and user-facing CLI/status strings predominantly in Chinese, including the module description and command help, with no indication that language selection is optional. The policy forbids forcing a specific language or locale unless the skill offers opt-in or clearly documents a justified regional constraint.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module and method documentation present this as an 'enhanced agent tool' modeled after a real agent system, and comments at L114-L115 and L219 explicitly acknowledge missing real execution and messaging. In practice, _run_agent_async only sleeps and marks the agent complete, while send_message only returns a success string, which contradicts the apparent operational intent conveyed by the interface and documentation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This file presents its module description and later all CLI output in Chinese, which imposes a specific language on users without any visible opt-in or alternative. Under the policy, forcing a language or locale without user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The command descriptions exposed to users are only in Chinese, and the same pattern continues throughout the CLI output paths. This creates a language-policy issue because the skill requires Chinese for normal operation without presenting a language choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module title, description, and user-facing docstrings are written only in Chinese, and all CLI help/status text in this file is likewise Chinese. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

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 · main.py (reported line 61)May include surrounding context.

python
- `/memory search <关键词>` - 搜索记忆

**任务工作流**
- `/task create <描述>` - 创建任务
- `/task progress` - 查看任务进度
- `/task next` - 进入下一阶段
- `/task complete <结果>` - 标记完成

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · main.py (reported line 83)May include surrounding context.

python
### 📚 文档

完整文档: `~/.openclaw/workspace/skills/claude-code-enhancement/SKILL.md`

"""

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The module-level description and all user-facing CLI strings are written only in Chinese, indicating an implicit language constraint for interaction and output. There is no indication that users can opt into another language or choose their locale, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module is explicitly designed to persist user preferences, feedback, project context, and reference material in a long-lived local file that an AI assistant will later read. In agent contexts, this creates a real confidentiality risk because sensitive prompts, secrets, or private project data may be retained longer than intended and then resurfaced, leaked to later tasks, or included in model context without adequate minimization or consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The clear method removes stored memory data by unlinking markdown files and reinitializing MEMORY.md, which is a destructive file-deletion operation. Although the CLI prints a success message afterward, there is no confirmation prompt or pre-action warning before deletion, and the method docstring does not disclose the destructive behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The top-level docstring says this component converts natural language into Skill commands, which implies parsing/translation behavior. However, the same module implements execute() and process_natural_language() that start/stop coordination, create tasks and agents, and add memory entries, so the documentation contradicts the actual side-effecting behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s natural-language descriptions, prompts, explanations, and trigger patterns are entirely Chinese-language specific, indicating the skill is designed to operate in a single language with no visible opt-in or alternative locale support. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

User-provided natural language can directly trigger persistent memory writes without any explicit confirmation, preview, or policy check in this module. In an agent setting, that makes prompt-injected or accidental phrases like '记住...' capable of storing unwanted, sensitive, or attacker-influenced data, which can later affect system behavior or leak through recall features.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Free-form input can directly create a new agent, a side-effectful operational action, without an interstitial confirmation or local authorization check. In agentic environments this increases the risk that ambiguous language or prompt injection causes unintended spawning of workers that consume resources, perform additional actions, or expand the blast radius of malicious instructions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

BYPASS mode unconditionally returns allowed=True for all tools, including BashTool, FileWriteTool, FileEditTool, and NetworkTool. In a permission system this effectively disables all safety controls, so any misuse, compromise, or accidental activation can lead to arbitrary command execution, file modification, or data exfiltration without user confirmation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

PLAN mode is documented as 'plan only, do not execute', but the check() method returns allowed=True with no confirmation. Any caller that treats this permission result as authoritative may execute destructive tools while the user believes execution is suppressed, creating a dangerous policy/implementation mismatch.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The permission system falls back to allowed=True for any tool not matched by existing rules or patterns. In a tool-based agent environment, new or renamed tools can perform destructive actions, so default-allow creates an easy path for risky capabilities to bypass review and user confirmation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

process_natural_language is documented as handling natural-language input, and the module is framed as an intent recognizer, but this function does more than recognition: it parses and then executes the matched intent. That is an intent/documentation divergence because callers relying on the documentation may not expect state-changing actions to occur from a natural-language handling helper.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module's user-facing text, docstrings, CLI usage, and status output are written in Chinese only, which imposes a language choice on users without opt-in or documented locale constraints. The policy requires flagging language or locale restrictions when the skill forces a specific language without giving the user a choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code reads an arbitrary config path from the caller and opens the file, but there is no confirmation prompt or user-facing disclosure at the point of access. For code files, file reads are not generally in scope, but here the operation affects local system data handling and the module provides no visible warning beyond an internal docstring in Chinese.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This Python file contains natural-language descriptions and user-facing CLI output in Chinese, starting with the module docstring and continuing throughout the interface. Under the language/locale policy, forcing a specific language without user opt-in can be a policy violation when no alternative or justification is provided.

Content

No source excerpt is available for this finding.