T09 · Insecure Skill Coding Practices
- Location
scripts/scan_skill.py:640- Finding
Scanner Follows Symbolic Links Outside the Target Skill Directory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a plausible OpenClaw skill security scanner, but its archive handling and deletion guidance create review-worthy local safety risks.
Install only if you are comfortable running it in a sandbox or low-privilege account. Avoid scanning untrusted .skill archives on a sensitive machine, and do not let an agent run the documented rm -rf removal step unless the target path has been resolved and confirmed to be inside an approved skills directory.
scripts/scan_skill.py:640Scanner Follows Symbolic Links Outside the Target Skill Directory
scripts/scan_skill.py:616Unbounded Archive Extraction and File Reading Allow Resource Exhaustion
SKILL.md:38Recursive Skill Deletion Guidance Does Not Require Target-Path Validation
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
",
"api.telegram.org": "Telegram Bot API",
"slack.com/api": "Slack API",
"discord.com/api": "Discord API",
"api.github.com": "GitHub API",
"graph.microsoft.com": "Microsoft Graph API",
"googleapis.com": "Google APIs",
"api.twilio.com": "Twilio API",
"api.sendgrid.com": "SendGrid API",
"api.stripe.com": "Stripe API",
"hooks.slack.com": "Slack Webhooks",
"webhook.site": "Webhook.site (data capture)",
"ngrok.io": "Ngrok Tunnel",
"requestbin": "RequestBin (data capture)",
"pipedream.net": "Pipedream (data capture)",
"burpcollaborator": "Burp Collaborator (security testing)",
"interact.sh": "Interactsh (data capture)",
"oast.fun": "OAST (data exfiltration)",
"dnslog.cn": "DNSLog (data exfiltration)",
"canarytokens.com": "Canary Tokens",
"pastebin.com": "Pastebin",
}
SAFE_URL_PREFIXES = [
"https://docs.", "https://github.com/", "https://stackoverflow.com/",
"https://en.wikipedia.org/", "https://www.pytho
Referenced artifact was not completely inspected
Accepts skill folders (containing `SKILL.md`) and packaged `.skill` files.
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
isk: str
title: str
detail: str
file: str = ""
line: int = 0
def to_dict(self):
d = {"category": self.category, "risk": self.risk, "title": self.title, "detail": self.detail}
if self.file:
d["file"] = self.file
if self.line:
d["line"] = self.line
return d
@dataclass
class AuditReport:
skill_name: str = ""
skill_description: str = ""
overall_risk: str = Risk.LOW
findings: list = field(default_factory=list)
required_env: list = field(default_factory=list)
required_bins: list = field(default_factory=list)
referenced_urls: list = field(default_factory=list)
referenced_apis: list = field(default_factory=list)
file_count: int = 0
script_count: int = 0
def add(self, finding: Finding):
self.findings.append(finding)
if RISK_ORDER.get(finding.risk, 0) > RISK_ORDER.get(self.overall_risk, 0):
self.overall_risk = finding.risk
def to_dict(self):
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
": "Microsoft Graph API",
"googleapis.com": "Google APIs",
"api.twilio.com": "Twilio API",
"api.sendgrid.com": "SendGrid API",
"api.stripe.com": "Stripe API",
"hooks.slack.com": "Slack Webhooks",
"webhook.site": "Webhook.site (data capture)",
"ngrok.io": "Ngrok Tunnel",
"requestbin": "RequestBin (data capture)",
"pipedream.net": "Pipedream (data capture)",
"burpcollaborator": "Burp Collaborator (security testing)",
"interact.sh": "Interactsh (data capture)",
"oast.fun": "OAST (data exfiltration)",
"dnslog.cn": "DNSLog (data exfiltration)",
"canarytokens.com": "Canary Tokens",
"pastebin.com": "Pastebin",
}
SAFE_URL_PREFIXES = [
"https://docs.", "https://github.com/", "https://stackoverflow.com/",
"https://en.wikipedia.org/", "https://www.python.org/",
"https://nodejs.org/", "https://example.com", "https://example.invalid",
"http://localhost", "http://127.0.0.1",
]
# ── Suspicious patterns ─────�
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
(r'rm\s+-rf?\s+/', "Recursive delete from root", Risk.CRITICAL),
(r'chmod\s+777|chmod\s+\+s', "Dangerous permission change", Risk.HIGH),
(r'sudo\s+', "Sudo usage", Risk.HIGH),
(r'/etc/passwd|/etc/shadow', "System file access", Risk.HIGH),
(r'~/.ssh|id_rsa|authorized_keys', "SSH key access", Risk.CRITICAL),
(r'~/.openclaw/openclaw\.json', "OpenClaw config access (may contain secrets)", Risk.HIGH),
(r'OPENAI_API_KEY|ANTHROPIC_API_KEY|API_KEY|SECRET|TOKEN', "Secret/key reference in code", Risk.MEDIUM),
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
(r'rm\s+-rf?\s+/', "Recursive delete from root", Risk.CRITICAL),
(r'chmod\s+777|chmod\s+\+s', "Dangerous permission change", Risk.HIGH),
(r'sudo\s+', "Sudo usage", Risk.HIGH),
(r'/etc/passwd|/etc/shadow', "System file access", Risk.HIGH),
(r'~/.ssh|id_rsa|authorized_keys', "SSH key access", Risk.CRITICAL),
(r'~/.openclaw/openclaw\.json', "OpenClaw config access (may contain secrets)", Risk.HIGH),
(r'OPENAI_API_KEY|ANTHROPIC_API_KEY|API_KEY|SECRET|TOKEN', "Secret/key reference in code", Risk.MEDIUM),
This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.
# ── Prompt injection patterns ────────────────────────────────────────────────
PROMPT_INJECTION_PATTERNS = [
(r'ignore\s+(all\s+)?previous\s+instructions', "Prompt injection: ignore previous instructions", Risk.CRITICAL),
(r'you\s+are\s+now\s+', "Prompt injection: identity override", Risk.HIGH),
(r'system\s*:\s*you\s+are', "Prompt injection: fake system message", Risk.CRITICAL),
(r'<\|?system\|?>', "Prompt injection: system token injection", Risk.CRITICAL),
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
(r'require\s*\(\s*[\'"]http', "HTTP module usage", Risk.LOW),
(r'fetch\s*\(', "fetch() network request", Risk.LOW),
(r'XMLHttpRequest', "XMLHttpRequest", Risk.LOW),
(r'process\.env', "Environment variable access", Risk.MEDIUM),
(r'Buffer\.from\(.*base64', "Base64 buffer operation", Risk.MEDIUM),
(r'WebSocket', "WebSocket connection", Risk.MEDIUM),
]
The skill advertises and instructs use of file reads, shell execution, and network-relevant scanning behavior, but it does not declare an explicit tool/permission scope. That creates a trust and review gap: an installer or operator cannot easily verify what capabilities the skill expects, which increases the chance of overbroad execution in sensitive environments.
The prescribed user responses for all risk levels are written in German, while the rest of the skill documentation is in English. This imposes a specific language on users without any stated opt-in or locale justification, which is a natural-language policy violation.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
(r'shutil\.rmtree|os\.remove|os\.unlink', "File deletion", Risk.MEDIUM),
(r'rm\s+-rf?\s+/', "Recursive delete from root", Risk.CRITICAL),
(r'chmod\s+777|chmod\s+\+s', "Dangerous permission change", Risk.HIGH),
(r'sudo\s+', "Sudo usage", Risk.HIGH),
(r'/etc/passwd|/etc/shadow', "System file access", Risk.HIGH),
(r'~/.ssh|id_rsa|authorized_keys', "SSH key access", Risk.CRITICAL),
(r'~/.openclaw/openclaw\.json', "OpenClaw config access (may contain secrets)", Risk.HIGH),
The scanner extracts untrusted .skill archives to disk before analysis using ZipFile.extractall(). Even though extraction occurs in a temporary directory, this expands the tool's capabilities beyond passive static inspection and can expose the host to archive-based issues such as zip slip/path traversal or resource exhaustion if crafted archives are supplied.
The tool writes attacker-controlled archive contents to disk automatically with no warning or confirmation. In a security scanner context, users may reasonably expect read-only behavior, so silent extraction increases risk from malformed archives and weakens trust boundaries.
The module docstring presents the tool as performing static analysis of skill folders, which implies inspection behavior. However, the implementation for .skill files actively extracts archive contents to a temporary directory, introducing a filesystem-writing side effect not reflected in the documentation.
Detected: suspicious.dangerous_exec, suspicious.dynamic_code_execution