Back to skill

Security audit

Silas Skill Auditor

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent skill-auditing guide, with some hardening issues around its temporary-directory cleanup and broad trigger wording.

Before installing, be aware that this skill may inspect skill directories and report on sensitive-looking strings it finds. Use it only for explicit skill-audit tasks, and prefer changing the documented temp workflow to a uniquely generated private directory with guarded cleanup instead of a fixed `/tmp/skill-audit-tmp` path.

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

Warning
Location
SKILL.md:29
Finding

Predictable Shared Temporary Directory Used with Unguarded Recursive Cleanup

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 29-32
Vulnerability Type: Unsafe temporary-directory handling
Risk Level: Medium
Classification: T09: Insecure Skill Coding Practices

Vulnerable Code

bash
# Fetch the remote Skill into a temporary directory without installing it
clawdhub install <skill-name> --dir /tmp/skill-audit-tmp
# Delete it after completing the audit
rm -rf /tmp/skill-audit-tmp

Technical Analysis

The documented pre-install audit workflow uses the fixed, globally predictable path /tmp/skill-audit-tmp. Shared temporary directories can be influenced by other local users or processes. The workflow does not create a uniquely named private directory, verify its ownership or canonical path, enforce restrictive permissions, or validate its type before passing it to clawdhub and recursively deleting it.

A local attacker could prepare or modify the predictable path before the workflow runs. Depending on the behavior of clawdhub, attacker-controlled files, links, permissions, or directory contents could interfere with package retrieval and inspection. The unconditional rm -rf also risks deleting unexpected content if the path is replaced or otherwise manipulated.

The command retrieves a remote package before it is audited. The documentation does not require lifecycle hooks or automatic execution to be disabled. If clawdhub install executes package-controlled hooks, this would undermine the purpose of pre-install review. The available project files do not establish whether such execution actually occurs, so this is a hardening concern rather than a confirmed remote-execution finding.

Attack Path

  1. A local attacker predicts that the auditor will use /tmp/skill-audit-tmp.
  2. The attacker creates or manipulates that path and places attacker-controlled content, links, or permissions within it.
  3. The user follows the documented workflow and invokes ...[truncated 1398 chars]
Remediation
View remediation

Remediation Suggestions

Replace the fixed path with a private, uniquely generated temporary directory and guarantee guarded cleanup:

bash
audit_dir="$(mktemp -d "${TMPDIR:-/tmp}/skill-audit.XXXXXXXX")" || exit 1
chmod 700 "$audit_dir"

cleanup() {
    case "$audit_dir" in
        "${TMPDIR:-/tmp}"/skill-audit.*)
            [ -d "$audit_dir" ] && [ ! -L "$audit_dir" ] && rm -rf -- "$audit_dir"
            ;;
        *)
            printf '%s\n' "Refusing to remove unexpected path" >&2
            return 1
            ;;
    esac
}
trap cleanup EXIT INT TERM

clawdhub install <skill-name> --dir "$audit_dir"

Additional hardening should include:

  1. Verify that the generated directory is owned by the current user and is not a symbolic link.
  2. Resolve and validate its canonical path before recursive cleanup.
  3. Use restrictive permissions such as mode 0700.
  4. Pass paths after -- where supported to prevent option interpretation.
  5. Configure clawdhub to download or unpack without running lifecycle hooks, setup scripts, or package code.
  6. Audit an immutable snapshot or record file hashes after retrieval so local modifications cannot silently alter the reviewed content.
  7. Abort if the temporary directory already exists or its ownership, permissions, or type differ from expectations.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (10)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Although the command deletes only a temporary directory, documenting raw rm -rf usage in an agent skill can still be dangerous if path substitution, variable expansion, or user-controlled input is introduced later. In a tooling context, destructive shell commands increase the blast radius of mistakes and can lead to data loss if the target path is wrong.

Content

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

拉取远程技能到临时目录(不安装)

clawdhub install <技能名> --dir /tmp/skill-audit-tmp

审查完成后删除

rm -rf /tmp/skill-audit-tmp

text

### 模式 B:已装审查

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Although the command deletes only a temporary directory, documenting raw rm -rf usage in an agent skill can still be dangerous if path substitution, variable expansion, or user-controlled input is introduced later. In a tooling context, destructive shell commands increase the blast radius of mistakes and can lead to data loss if the target path is wrong.

Content

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

拉取远程技能到临时目录(不安装)

clawdhub install <技能名> --dir /tmp/skill-audit-tmp

审查完成后删除

rm -rf /tmp/skill-audit-tmp

text

### 模式 B:已装审查

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `SKILL.md` — 指令文件(可能含 prompt 注入)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% 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).

Content

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

md
| C3 | 远程代码执行 | 搜索 `eval(`, `exec(`, `Function(`, `child_process`, `os.system`, `subprocess` |
| C4 | Prompt 注入 | 搜索 `ignore previous`, `ignore instructions`, `system prompt`, `你现在是` |
| C5 | 持久化/后门 | 搜索 `crontab`, `systemd`, `launchd`, `autorun`, `always:true`, `startup` |
| C6 | 提权操作 | 搜索 `sudo`, `chmod 777`, `chown`, `setuid`, `CAP_` |

#### 🟡 中等风险(Warning)

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 85)May include surrounding context.

md
| # | 检查项 | 检查方法 |
|---|--------|----------|
| W1 | 敏感路径访问 | 搜索 `~/.ssh`, `~/.aws`, `~/.openclaw`, `/etc/passwd`, `/etc/shadow` |
| W2 | 文件系统越界 | 搜索 `../`, `/tmp`, `/var`, 写入非技能目录的操作 |
| W3 | 环境变量读取 | 搜索 `process.env`, `os.environ`, `$HOME`, `getenv` |
| W4 | 外部依赖 | 检查是否需要安装额外包/CLI |

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

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

Content

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

md
| # | 检查项 | 检查方法 |
|---|--------|----------|
| W1 | 敏感路径访问 | 搜索 `~/.ssh`, `~/.aws`, `~/.openclaw`, `/etc/passwd`, `/etc/shadow` |
| W2 | 文件系统越界 | 搜索 `../`, `/tmp`, `/var`, 写入非技能目录的操作 |
| W3 | 环境变量读取 | 搜索 `process.env`, `os.environ`, `$HOME`, `getenv` |
| W4 | 外部依赖 | 检查是否需要安装额外包/CLI |

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrase “检查安全” is broad enough to match ordinary user requests about general safety, not specifically skill auditing. This can cause the skill to activate in unintended contexts, leading to confusing behavior or unnecessary handling of unrelated user input.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill description and operational text are presented as Chinese-only instructions, and no user opt-in or language selection is offered. This can violate language/locale policy when users expect responses in their own preferred language.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
| C3 | 远程代码执行 | 搜索 `eval(`, `exec(`, `Function(`, `child_process`, `os.system`, `subprocess` |
| C4 | Prompt 注入 | 搜索 `ignore previous`, `ignore instructions`, `system prompt`, `你现在是` |
| C5 | 持久化/后门 | 搜索 `crontab`, `systemd`, `launchd`, `autorun`, `always:true`, `startup` |
| C6 | 提权操作 | 搜索 `sudo`, `chmod 777`, `chown`, `setuid`, `CAP_` |

#### 🟡 中等风险(Warning)

Vague Triggers

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

These lines describe a broad situation in which the skill may be relevant, but they do not clearly define when the skill should activate versus merely be suggested. The absence of explicit trigger boundaries increases the risk of unintended invocation in general security-related conversations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.