Skill Security Scanner
Protect your OpenClaw installation from malicious skills. This scanner performs static analysis on skill code to detect:
- Code Execution Threats:
eval, exec, os.system, subprocess calls
- Data Exfiltration: Hidden network requests, suspicious URLs, IP connections
- System Compromise: File deletion, permission changes, privilege escalation
- Credential Theft: Environment variable access, secret harvesting
- Cryptojacking: Mining malware, suspicious compute patterns
- Obfuscation: Hidden code, base64 encoding, minification
- Spyware: Keyloggers, screen capture, surveillance features
Quick Start
# Basic scan
python scripts/security_scanner.py /path/to/skill
# Strict mode (catches more suspicious patterns)
python scripts/security_scanner.py /path/to/skill --strict
# Save JSON report
python scripts/security_scanner.py /path/to/skill --format json -o report.json
# Generate markdown report
python scripts/security_scanner.py /path/to/skill --format markdown -o report.md
Understanding Results
Verdict Levels
| Verdict |
Emoji |
Meaning |
Action |
| PASS |
🟢 |
No critical issues found |
Safe to install |
| REVIEW |
🟡 |
Some concerns, review recommended |
Check findings before installing |
| WARNING |
🟠 |
High-risk patterns detected |
Strongly reconsider installation |
| REJECT |
🔴 |
Critical threats identified |
DO NOT INSTALL |
Security Score
- 90-100: Excellent - minimal risk
- 70-89: Good - minor issues
- 50-69: Fair - requires review
- 0-49: Poor - significant risks
Detection Rules
Critical (🔴)
| Rule |
Description |
Example |
| EXEC001 |
Code execution functions |
eval(), exec(), compile() |
| SUSPICIOUS001 |
Keylogger functionality |
pynput, keyboard modules |
| SUSPICIOUS003 |
Cryptocurrency mining |
mining, bitcoin, stratum+tcp |
High (🟠)
| Rule |
Description |
Example |
| EXEC002 |
System command execution |
os.system(), subprocess.call() |
| NET002 |
Raw socket connections |
socket.connect() |
| ENV001 |
Sensitive credential access |
os.environ['PASSWORD'] |
| OBF001 |
Code obfuscation |
Base64, hex-encoded code |
| SUSPICIOUS002 |
Screen capture |
pyautogui.screenshot() |
| NET004 |
Short URL usage |
bit.ly, tinyurl links |
Medium (🟡)
| Rule |
Description |
Example |
| NET001 |
HTTP network requests |
requests.get(), fetch() |
| ENV002 |
Environment enumeration |
os.environ.items() |
| FILE001 |
File deletion |
os.remove(), shutil.rmtree() |
| DATA001 |
Unsafe deserialization |
pickle.loads(), yaml.load() |
| NET003 |
Hardcoded IP addresses |
Direct IP in URLs |
| OBF002 |
Base64 encoded blocks |
Large base64 strings |
Low/Info (🔵/⚪)
| Rule |
Description |
| FILE002 |
File write operations |
| CRYPTO001 |
Cryptographic operations |
| DOC001 |
Insufficient documentation |
| DOC002 |
Missing security statements |
Workflow
Before Installing a New Skill
Download the skill to a temporary directory
Run the security scanner
Review the verdict:
- 🟢 PASS: Proceed with installation
- 🟡 REVIEW: Examine findings, verify legitimate use
- 🟠 WARNING: Only install from trusted sources
- 🔴 REJECT: Do not install
For 🟡/🟠 findings, manually review the flagged code
Confirm the skill's behavior matches its documentation
Before Updating an Existing Skill
- Run scanner on the new version
- Compare results with previous version's scan
- Check for new critical/high findings
- Review any new network/file operations
Automated Integration
Add to your skill installation workflow:
import subprocess
import sys
def safe_install_skill(skill_path):
# Run security scan
result = subprocess.run(
['python', 'scripts/security_scanner.py', skill_path, '--format', 'json'],
capture_output=True,
text=True
)
import json
report = json.loads(result.stdout)
if report['summary']['verdict'] == 'REJECT':
print("❌ Installation blocked: Critical security issues found")
return False
if report['summary']['verdict'] == 'WARNING':
response = input("⚠️ High-risk patterns detected. Install anyway? (y/N): ")
if response.lower() != 'y':
return False
# Proceed with installation
return True
Handling False Positives
Some legitimate skills may trigger warnings:
- Network requests: Skills that fetch data from APIs
- File operations: Skills that modify documents
- Encryption: Skills handling sensitive data
When you trust the source and understand the functionality, you can:
- Review the specific code flagged
- Verify it matches the documented purpose
- Manually approve if confident
Reporting Issues
If you find a skill with confirmed malicious intent:
- Do not install or run it
- Report to the skill repository/hosting platform
- Notify OpenClaw community channels
- Share scan report (without executing the skill)
Best Practices
- Only install skills from trusted sources
- Always scan before installing - even from trusted sources
- Review findings carefully - understand what the skill does
- Keep scanner updated - new detection rules added regularly
- Use strict mode for untrusted sources - catches more suspicious patterns
- Check skill updates - re-scan when updating existing skills
Exit Codes
The scanner returns specific exit codes:
| Code |
Meaning |
| 0 |
PASS or REVIEW - installation may proceed |
| 1 |
WARNING - high-risk patterns found |
| 2 |
REJECT - critical threats detected |
Use in scripts:
python scripts/security_scanner.py ./skill || {
echo "Security check failed"
exit 1
}
1---2name: skill-security-scanner-23description: Security scanner for OpenClaw skills. Use when installing, updating, or auditing skills to detect malicious backdoors, suspicious code patterns, data exfiltration risks, and security vulnerabilities. Automatically analyzes Python/JavaScript/Shell code for dangerous functions (eval, exec, system calls), network requests, file operations, environment variable access, obfuscation patterns, and known attack signatures. Provides security score and installation recommendations.4metadata:5 source: https://skillmd.com/skills/modbender/skill-security-scanner-26---78# Skill Security Scanner910Protect your OpenClaw installation from malicious skills. This scanner performs static analysis on skill code to detect:1112- **Code Execution Threats**: `eval`, `exec`, `os.system`, `subprocess` calls13- **Data Exfiltration**: Hidden network requests, suspicious URLs, IP connections 14- **System Compromise**: File deletion, permission changes, privilege escalation15- **Credential Theft**: Environment variable access, secret harvesting16- **Cryptojacking**: Mining malware, suspicious compute patterns17- **Obfuscation**: Hidden code, base64 encoding, minification18- **Spyware**: Keyloggers, screen capture, surveillance features1920## Quick Start2122```bash23# Basic scan24python scripts/security_scanner.py /path/to/skill2526# Strict mode (catches more suspicious patterns)27python scripts/security_scanner.py /path/to/skill --strict2829# Save JSON report30python scripts/security_scanner.py /path/to/skill --format json -o report.json3132# Generate markdown report33python scripts/security_scanner.py /path/to/skill --format markdown -o report.md34```3536## Understanding Results3738### Verdict Levels3940| Verdict | Emoji | Meaning | Action |41|---------|-------|---------|--------|42| **PASS** | 🟢 | No critical issues found | Safe to install |43| **REVIEW** | 🟡 | Some concerns, review recommended | Check findings before installing |44| **WARNING** | 🟠 | High-risk patterns detected | Strongly reconsider installation |45| **REJECT** | 🔴 | Critical threats identified | **DO NOT INSTALL** |4647### Security Score4849- **90-100**: Excellent - minimal risk50- **70-89**: Good - minor issues51- **50-69**: Fair - requires review52- **0-49**: Poor - significant risks5354## Detection Rules5556### Critical (🔴)5758| Rule | Description | Example |59|------|-------------|---------|60| EXEC001 | Code execution functions | `eval()`, `exec()`, `compile()` |61| SUSPICIOUS001 | Keylogger functionality | `pynput`, `keyboard` modules |62| SUSPICIOUS003 | Cryptocurrency mining | `mining`, `bitcoin`, `stratum+tcp` |6364### High (🟠)6566| Rule | Description | Example |67|------|-------------|---------|68| EXEC002 | System command execution | `os.system()`, `subprocess.call()` |69| NET002 | Raw socket connections | `socket.connect()` |70| ENV001 | Sensitive credential access | `os.environ['PASSWORD']` |71| OBF001 | Code obfuscation | Base64, hex-encoded code |72| SUSPICIOUS002 | Screen capture | `pyautogui.screenshot()` |73| NET004 | Short URL usage | `bit.ly`, `tinyurl` links |7475### Medium (🟡)7677| Rule | Description | Example |78|------|-------------|---------|79| NET001 | HTTP network requests | `requests.get()`, `fetch()` |80| ENV002 | Environment enumeration | `os.environ.items()` |81| FILE001 | File deletion | `os.remove()`, `shutil.rmtree()` |82| DATA001 | Unsafe deserialization | `pickle.loads()`, `yaml.load()` |83| NET003 | Hardcoded IP addresses | Direct IP in URLs |84| OBF002 | Base64 encoded blocks | Large base64 strings |8586### Low/Info (🔵/⚪)8788| Rule | Description |89|------|-------------|90| FILE002 | File write operations |91| CRYPTO001 | Cryptographic operations |92| DOC001 | Insufficient documentation |93| DOC002 | Missing security statements |9495## Workflow9697### Before Installing a New Skill98991. Download the skill to a temporary directory1002. Run the security scanner1013. Review the verdict:102 - 🟢 **PASS**: Proceed with installation103 - 🟡 **REVIEW**: Examine findings, verify legitimate use104 - 🟠 **WARNING**: Only install from trusted sources105 - 🔴 **REJECT**: Do not install1061074. For 🟡/🟠 findings, manually review the flagged code1085. Confirm the skill's behavior matches its documentation109110### Before Updating an Existing Skill1111121. Run scanner on the new version1132. Compare results with previous version's scan1143. Check for new critical/high findings1154. Review any new network/file operations116117### Automated Integration118119Add to your skill installation workflow:120121```python122import subprocess123import sys124125def safe_install_skill(skill_path):126 # Run security scan127 result = subprocess.run(128 ['python', 'scripts/security_scanner.py', skill_path, '--format', 'json'],129 capture_output=True,130 text=True131 )132 133 import json134 report = json.loads(result.stdout)135 136 if report['summary']['verdict'] == 'REJECT':137 print("❌ Installation blocked: Critical security issues found")138 return False139 140 if report['summary']['verdict'] == 'WARNING':141 response = input("⚠️ High-risk patterns detected. Install anyway? (y/N): ")142 if response.lower() != 'y':143 return False144 145 # Proceed with installation146 return True147```148149## Handling False Positives150151Some legitimate skills may trigger warnings:152153- **Network requests**: Skills that fetch data from APIs154- **File operations**: Skills that modify documents155- **Encryption**: Skills handling sensitive data156157When you trust the source and understand the functionality, you can:1581591. Review the specific code flagged1602. Verify it matches the documented purpose1613. Manually approve if confident162163## Reporting Issues164165If you find a skill with confirmed malicious intent:1661671. Do not install or run it1682. Report to the skill repository/hosting platform1693. Notify OpenClaw community channels1704. Share scan report (without executing the skill)171172## Best Practices1731741. **Only install skills from trusted sources**1752. **Always scan before installing** - even from trusted sources1763. **Review findings carefully** - understand what the skill does1774. **Keep scanner updated** - new detection rules added regularly1785. **Use strict mode for untrusted sources** - catches more suspicious patterns1796. **Check skill updates** - re-scan when updating existing skills180181## Exit Codes182183The scanner returns specific exit codes:184185| Code | Meaning |186|------|---------|187| 0 | PASS or REVIEW - installation may proceed |188| 1 | WARNING - high-risk patterns found |189| 2 | REJECT - critical threats detected |190191Use in scripts:192193```bash194python scripts/security_scanner.py ./skill || {195 echo "Security check failed"196 exit 1197}198```