Back to skill

Security audit

Claw Security Scanner

Security checks for vulnerabilities and agentic risk

Overview

This security-scanner skill is not clearly malicious, but it needs review because it may expose the secrets it finds in reports and relies on mutable install sources.

Install only from a pinned, reviewed release or commit, run the scanner as an unprivileged user, avoid sudo, and treat generated reports as sensitive because they may contain real secrets from scanned files. Review report output before uploading it to CI artifacts, tickets, or shared logs.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
claw_security_scanner.py:178
Finding

Credential values are retained and exposed in generated reports

Content
View full analysis
100: evidence = evidence[:100] + "..." ``` The captured value is stored directly in each finding: ```python finding = SecurityFinding( id=f"cred_{hashlib.md5(f'{file_path}:{line_number}'.encode()).hexdigest()[:8]}", category=DetectionCategory.CREDENTIALS, risk_level=risk_level, file_path=file_path, line_number=line_number, description=f"检测到潜在的凭据泄露: {match.group(1) if match.groups() else '敏感信息'}", evidence=evidence, recommendation="移除硬编码的凭据,使用环境变量或安全的配置管理系统", detector_name=self.name, fix_available=True, auto_fixable=False ) ``` Report-generation paths subsequently expose the value: ```python if format == "json": return result.to_json() ``` ```python report_lines.append(f"- **证据**: `{finding.evidence}`") ``` ```python if args.output: with open(args.output, 'w', encoding='utf-8') as f: f.write(report) ``` ### Technical Analysis The credential detector preserves the entire regular-expression match, truncating it only after 100 characters. This is not effective secret redaction: API keys, passwords, tokens, database credentials, and substantial portions of private-key-related data may fit entirely within that limit. The raw value is retained in `SecurityFinding.evidence`, exposed through the Python API, included directly in Markdown reports, and intended to be included in JSON serialization. Reports can then be written to a caller-selected file without restrictive file permissions. A security scanner only needs the credential type, source location, and safely masked context to report a finding; retaining the plaintext ...[truncated 1962 chars]
Remediation
View remediation
str: if len(value) <= 8: return "[REDACTED]" return f"{value[:4]}...[REDACTED]...{value[-4:]}" ``` 3. Prefer evidence such as `API_KEY = "[REDACTED]"` rather than masking the full matched string indiscriminately. 4. Ensure `SecurityFinding.evidence` can never contain plaintext credential material before it reaches any report generator or API consumer. 5. Create output files with owner-only permissions, such as mode `0o600`, and warn users that reports may still contain sensitive file paths and code context. 6. Avoid emitting reports to shared logs or standard output in CI unless all sensitive fields have been sanitized. 7. Add tests using sentinel secrets and assert that no complete sentinel, password, token, connection string, or private-key body appears in Markdown, JSON, console output, logs, or serialized findings. 8. Correct JSON enum serialization separately so that risk and category values are safely converted to strings without reintroducing raw secret evidence. ]]>

T08 · Insecure Dependencies

Warning
Location
package.json:50
Finding

Unpinned and mismatched dependency declarations create supply-chain exposure

Content
View full analysis
=2.25.1", "pyyaml": ">=6.0", "colorama": ">=0.4.6", "semantic-version": ">=2.10.0" }, "devDependencies": { "pytest": ">=7.0.0", "pytest-cov": ">=4.0.0" } ``` The installation documentation also recommends mutable sources: ```bash pip install git+https://github.com/openclaw-skills/claw-security-scanner.git ``` ```bash docker pull clawsecurity/scanner:latest ``` ### Technical Analysis The implementation imports Python modules, but its dependencies are declared in `package.json`, which is an npm manifest. Package names shared across ecosystems do not guarantee that the npm packages have any relationship to the intended Python packages. An npm-compatible installation workflow may therefore resolve packages from the wrong ecosystem. All dependency constraints are open-ended, and the audited project contains no lockfile or hash-verified Python dependency manifest. Consequently, installations performed at different times may resolve different code than the code reviewed during this audit. The documentation compounds this problem by recommending installation directly from a mutable Git branch and use of a `latest` container tag. Both references can change after review without any modification to the audited artifact. This does not prove that any currently named package or remote image is malicious. The vulnerability is the lack of ecosystem-correct, immutable, and reproducible dependency resolution. ### Attack Path 1. A user follows the installation instructions or an OpenClaw/npm-compatible installer processes `package.json`. 2. The installer resolves open-ended package versions, packages from an unintended ecosystem, a mutable Git branch, or a mutable container tag. 3. A dependency publisher, compromised upstream account, ...[truncated 1256 chars]
Remediation
View remediation
" ``` 6. Pin container images by cryptographic digest rather than `latest`: ```bash docker pull clawsecurity/scanner@sha256: ``` 7. Run dependency installation without administrator privileges and disable unnecessary installation scripts where the package manager permits it. 8. Add automated dependency review, vulnerability scanning, provenance verification, and reproducible-build checks to release workflows. 9. Publish a lockfile or software bill of materials so users can verify that installed components match the reviewed release. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (34)

YARA rule 'agent_skill_remote_bootstrap_execution': Remote script or code download followed by execution/bootstrap installation [agent_skills]

High
Category
YARA Match
Confidence
87% confidence
Finding

The installation guide repeatedly recommends installing directly from a remote GitHub repository via pip install git+https://..., which executes package build/install logic from a moving remote source outside a pinned release artifact. In a skill context, this is a meaningful supply-chain risk: if the repository or upstream dependency chain is compromised, users may run attacker-controlled code during installation with no integrity pinning or checksum verification.

Content

Scanner excerpt · INSTALLATION.md (reported line 35)May include surrounding context.

手动安装

bash
# 克隆仓库
git clone https://github.com/openclaw-skills/claw-security-scanner.git

# 复制到OpenClaw技能目录
cp -r claw-security-scanner ~/.openclaw/skills/

# 或使用符号链接
ln -s $(pwd)/claw-security-scanner ~/.openclaw/skills/

方法3:Python包安装

bash
# 从PyPI安装(如果可用)
pip install claw-security-scanner

# 从GitHub安装
pip install git+https://github.com/openclaw-skills/claw-security-scanner.git

⚙️ 配置

OpenClaw集成配置

在 ~/.openclaw/config.json 中添加以下配置:

json
{
  "skills": {
    "claw-security-scanner": {
      "enabled": true,
      "config": {
        "autoScan": true,
        "scanOnInstall": true,
        "scanOnUpdate": true,
        "severityThreshold": "medium",
        "reportFormat": "detailed",
        "notifyOnRisk": true,
        "backupBeforeFix": true,
        "excludePatterns": [
          "node_modules",
          ".git",
          "__pycache__",

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · INSTALLATION.md (reported line 191)May include surrounding context.

md
clawdhub uninstall claw-security-scanner

# 或手动卸载
rm -rf ~/.openclaw/skills/security-scanner

# 清理配置
rm -f ~/.openclaw/config/security-scanner.json

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · INSTALLATION.md (reported line 191)May include surrounding context.

md
clawdhub uninstall claw-security-scanner

# 或手动卸载
rm -rf ~/.openclaw/skills/security-scanner

# 清理配置
rm -f ~/.openclaw/config/security-scanner.json

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · INSTALLATION.md (reported line 194)May include surrounding context.

rm -rf ~/.openclaw/skills/security-scanner

清理配置

rm -f ~/.openclaw/config/security-scanner.json

text

## 🐳 Docker支持

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · claw_security_scanner.py (reported line 213)May include surrounding context.

python
(r'__import__\([\s\S]{0,100}\)', RiskLevel.HIGH),
            
            # 文件系统操作(可疑)
            (r'open\([^)]*["\']/(etc/passwd|etc/shadow|\.ssh/id_rsa)["\']', RiskLevel.CRITICAL),
            (r'subprocess\.(Popen|run|call)\([^)]*["\'](rm -rf|format|dd if)', RiskLevel.CRITICAL),
            
            # 网络连接(可疑)

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 · test_security_scanner.py (reported line 39)May include surrounding context.

python
import subprocess

# 可疑的文件访问
with open("/etc/passwd", "r") as f:
    passwords = f.read()

# 可疑的命令执行

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 · test_security_scanner.py (reported line 64)May include surrounding context.

python
""",
        
        # 环境文件
        ".env": """
DATABASE_URL=postgresql://user:password@localhost/db
SECRET_KEY=super_secret_key_123
API_KEY=test_api_key_456

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 · claw_security_scanner.py (reported line 356)May include surrounding context.

python
"""
    
    # 创建临时文件
    with tempfile.NamedTemporaryFile(mode='w', suffix='.env', delete=False) as f:
        f.write(test_content)
        temp_file = f.name

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 · claw_security_scanner.py (reported line 437)May include surrounding context.

python
"""
    
    # 创建临时文件
    with tempfile.NamedTemporaryFile(mode='w', suffix='.env', delete=False) as f:
        f.write(test_content)
        temp_file = f.name

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 · test_security_scanner.py (reported line 262)May include surrounding context.

python
"""
    
    # 创建临时文件
    with tempfile.NamedTemporaryFile(mode='w', suffix='.env', delete=False) as f:
        f.write(test_content)
        temp_file = f.name

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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 · INSTALLATION.md (reported line 145)May include surrounding context.

md
}

# 创建配置目录
mkdir -p ~/.openclaw/config

# 添加配置
cat > ~/.openclaw/config/security-scanner.json << EOF

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The markdown provides rm -rf ~/.openclaw/skills/security-scanner and rm -f ~/.openclaw/config/security-scanner.json as uninstall steps, which delete user files and configuration. Although labeled as uninstall and cleanup, the document does not explicitly warn that these operations are irreversible and may remove local modifications or settings.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

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

bash
# 以非特权用户运行
sudo -u nobody security-scan /path/to/skill

# 限制文件访问
security-scan --chroot /safe/path /path/to/skill

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

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

md
# 或使用系统包管理器
# Ubuntu/Debian
sudo apt-get install python3-pip python3-dev

# CentOS/RHEL
sudo yum install python3-pip python3-devel

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

md
# 或使用系统包管理器
# Ubuntu/Debian
sudo apt-get install python3-pip python3-dev

# CentOS/RHEL
sudo yum install python3-pip python3-devel

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
79% confidence
Finding

The troubleshooting section suggests sudo security-scan /path/to/skill as a fallback for permission errors, which encourages running a complex scanner with elevated privileges on potentially untrusted input. If the scanner or one of its parsers has a flaw, processing attacker-controlled skill content as root could amplify impact to full system compromise or destructive file access.

Content

Scanner excerpt · INSTALLATION.md (reported line 392)May include surrounding context.

chmod +x ~/.openclaw/skills/security-scanner/claw_security_scanner.py chmod +x ~/.openclaw/skills/security-scanner/security-scan

或使用sudo

sudo security-scan /path/to/skill

text

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
79% confidence
Finding

This continues the prior recommendation to invoke security-scan with sudo, which is unsafe for a tool intended to inspect untrusted skill content. The skill context makes this more concerning because security scanners often parse many file types and may be pointed at adversarial repositories, so unnecessary root execution increases blast radius.

Content

Scanner excerpt · INSTALLATION.md (reported line 393)May include surrounding context.

chmod +x ~/.openclaw/skills/security-scanner/security-scan

或使用sudo

sudo security-scan /path/to/skill

text

### 获取帮助

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The primary skill description is presented in Chinese and the rest of the README continues exclusively in Chinese, with no indication that users may choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is justified, which is not stated here.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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 · SKILL.md (reported line 47)May include surrounding context.

clawdhub install claw-security-scanner

或手动安装

mkdir -p ~/.openclaw/skills/security-scanner cp -r ./* ~/.openclaw/skills/security-scanner/

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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 · SKILL.md (reported line 47)May include surrounding context.

clawdhub install claw-security-scanner

或手动安装

mkdir -p ~/.openclaw/skills/security-scanner cp -r ./* ~/.openclaw/skills/security-scanner/

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file documents a repair mode using --auto-fix, which implies automatic changes to scanned skills or related files. The description does not include any warning about potential file modification, review requirements, or backup implications near the command example, so users are not clearly alerted to a behavior that could affect their data or system state.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.destructive_delete_command, suspicious.dynamic_code_execution, suspicious.exposed_secret_literal

Documentation contains a destructive delete command without an explicit confirmation gate.

Warn
Code
suspicious.destructive_delete_command
Location
INSTALLATION.md:191

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
test_security_scanner.py:136

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
test_security_scanner.py:27