Back to skill

Security audit

Skill Security Scanner by dxx

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local security scanner for OpenClaw skills, but its clean results should not be treated as complete because it skips documentation and instruction files.

Install only if you want a lightweight local pattern scanner. Treat its output as advisory: it can flag obvious risky strings in code files, but it can miss malicious or unsafe instructions hidden in SKILL.md, README, text files, or behavior that simple regexes do not cover. Review important skills manually and do not rely on a clean result as proof of safety.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
skill_scan.py:72
Finding
Security Scanner Excludes Skill Instruction and Documentation Files<![CDATA[ ## Vulnerability Details **File Location**: `skill_scan.py:72-76` **Vulnerability Type**: Incomplete security scanning caused by extension-based exclusions **Risk Level**: High ### Vulnerable Code ```python # 扫描所有文件 for file_path in skill_path.rglob('*'): if file_path.is_file(): # 跳过文档和示例文件 if file_path.name in ['SKILL.md', 'README.md', 'CHANGELOG.md']: continue if file_path.suffix in ['.md', '.txt', '.rst']: continue ``` ### Technical Analysis The scanner recursively enumerates files but deliberately excludes `SKILL.md`, named documentation files, and every file with a `.md`, `.txt`, or `.rst` extension. In an AI-agent skill, `SKILL.md` is not merely passive documentation. It can define instructions that influence the agent when the skill is loaded. Malicious instructions could attempt to override existing constraints, direct the agent to access credentials, execute commands through available tools, retrieve external content, or alter its current goals. Because these files never reach `scan_file()`, none of the scanner's dangerous-command, sensitive-path, or network-request checks are applied to them. An instruction-only malicious skill can therefore receive an `[OK]` result. This also conflicts with the documented claim that the tool scans all installed skills. The issue is a security-control bypass and false-negative condition rather than evidence that this project itself contains malicious instructions. No command execution, data exfiltration, persistence, credential theft, or direct SSH-key access was found in the audited project. The SSH path present in the source is only a detection pattern. ### Attack Path 1. An attacker creates a skill whose executable scripts appear benign or are absent. 2. The attacker places harmful agent instructions or dangerous command guidance in `SKILL.md` or another excluded text file. 3. A user installs the attacker-controlled skill under the configured sk ...[truncated 1288 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the blanket exclusions for `SKILL.md`, `.md`, `.txt`, and `.rst` files. Treat readable text files as security-relevant input regardless of whether they are documentation or code. 2. Always scan the primary skill manifest and instruction files, including `SKILL.md`, before scanning executable files. 3. Add instruction-specific detection rules for: - Attempts to override higher-priority instructions or safety constraints. - Requests to disclose credentials, tokens, private keys, or sensitive files. - Directions to execute shell commands or invoke privileged tools. - Remote payload retrieval or untrusted URL access. - Persistence, memory modification, or configuration tampering. - Attempts to conceal actions or suppress user confirmation. 4. Distinguish findings discovered in executable code from findings discovered in agent instructions, but do not exclude either category. 5. Replace filename-only binary detection with content-aware classification, such as MIME inspection or checking for null bytes, so attackers cannot bypass scanning through misleading extensions. 6. Add regression tests containing dangerous commands and instruction-hijacking text in `SKILL.md`, `README.md`, `.txt`, and `.rst` files. Verify that each test produces a finding rather than an `[OK]` result. 7. Clearly state the scanner's limitations and avoid presenting a clean regex scan as proof that a skill is safe. ]]>
Vulnerability Patterns
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
## 功能

- 🔍 扫描所有已安装 skill
- ⚠️ 检测危险命令(rm -rf /、fork 炸弹等)
- 🔒 检查敏感路径访问
- 🌐 检查网络请求安全性
- 📊 生成风险报告
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
## 功能

- 🔍 扫描所有已安装 skill
- ⚠️ 检测危险命令(rm -rf /、fork 炸弹等)
- 🔒 检查敏感路径访问
- 🌐 检查网络请求安全性
- 📊 生成风险报告
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
## 功能

- 🔍 扫描所有已安装 skill
- ⚠️ 检测危险命令(rm -rf /、fork 炸弹等)
- 🔒 检查敏感路径访问
- 🌐 检查网络请求安全性
- 📊 生成风险报告
Confidence
85% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
## 功能

- 🔍 扫描所有已安装 skill
- ⚠️ 检测危险命令(rm -rf /、fork 炸弹等)
- 🔒 检查敏感路径访问
- 🌐 检查网络请求安全性
- 📊 生成风险报告
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
## 检查项

### 高风险
- `rm -rf /` - 删除根目录
- `rm -rf ~` - 删除用户目录
- Fork 炸弹
- 直接写入磁盘设备
Confidence
85% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
### 高风险
- `rm -rf /` - 删除根目录
- `rm -rf ~` - 删除用户目录
- Fork 炸弹
- 直接写入磁盘设备
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Credential Access

High
Category
Privilege Escalation
Content
# 敏感文件路径
    SENSITIVE_PATHS = [
        '/etc/passwd',
        '/etc/shadow',
        '/etc/hosts',
        '/.ssh/',
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
# 敏感文件路径
    SENSITIVE_PATHS = [
        '/etc/passwd',
        '/etc/shadow',
        '/etc/hosts',
        '/.ssh/',
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
# 敏感文件路径
    SENSITIVE_PATHS = [
        '/etc/passwd',
        '/etc/shadow',
        '/etc/hosts',
        '/.ssh/',
        '/.aws/',
Confidence
95% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Natural-Language Policy Violations

Medium
Confidence
81% confidence
Finding
All listed trigger keywords and conditions are written only in Chinese, and the skill documentation also uses Chinese without indicating that users may interact in other languages. This can constitute a language policy violation when no user opt-in or justified region-specific constraint is documented.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The trigger keyword "检查skill" is generic and could overlap with ordinary user requests to review or inspect a skill, not specifically to run this security-scan skill. The manifest does not provide negative examples or tighter scope constraints to distinguish this skill from other skill-inspection intents.

Vague Triggers

Medium
Confidence
87% confidence
Finding
The condition "需要检查skill安全性" is a broad natural-language description rather than a narrowly defined activation rule. Without explicit boundaries or exclusions, it may activate on loosely related conversations about skill safety instead of a clear request to perform a scan.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The scanner intentionally skips markdown and other text documentation files, even though skills commonly place operating instructions, setup steps, and shell commands in README/SKILL documentation. An attacker can hide dangerous guidance or user-triggered commands in those files, causing the scanner to miss socially engineered harmful behavior despite claiming a security scan.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
The module description and user-facing output are written in Chinese, and the file does not indicate that the skill is region-specific or that users can choose another language. This can violate a language/locale policy when a skill implicitly forces a specific language without user opt-in.

Static analysis

No suspicious patterns detected.