OpenClaw vulnerability scanner - Detect ClawJacked (CVE-2026-CLAW)
Project description
ClawCheck
🛡️ OpenClaw Vulnerability Scanner
Detect the ClawJacked vulnerability (CVE-2026-CLAW) in OpenClaw installations
Quick Start
pip install clawcheck
clawcheck
Overview
ClawCheck is a CLI security tool that detects the ClawJacked vulnerability in OpenClaw installations. The vulnerability, disclosed by Oasis Security on February 26, 2026, allows any website to silently hijack OpenClaw agents through WebSocket exploitation.
What it does:
- ✅ Scans for OpenClaw installations
- ✅ Checks version against vulnerable range (
< 2026.2.25) - ✅ Probes WebSocket gateway for security indicators
- ✅ Provides remediation guidance
- ✅ CI/CD integration (JSON/SARIF output)
What it doesn't do:
- ❌ No external data transmission (offline-capable)
- ❌ No brute-force attacks (read-only probes)
- ❌ No system modifications (in scan mode)
Installation
pip (Recommended)
pip install clawcheck
pipx (Isolated Installation)
pipx install clawcheck
From Source
git clone https://github.com/yourusername/clawcheck.git
cd clawcheck
pip install -e .
Usage
Basic Scan
clawcheck
Scan Flow
flowchart TD
A[clawcheck] --> B{OpenClaw Found?}
B -->|No| C[Exit Code: 3]
B -->|Yes| D{Version Vulnerable?}
D -->|Yes| E[VULNERABLE]
D -->|No| F[SECURE]
E --> G[Show Remediation]
F --> H[Exit Code: 0]
C --> I[Exit Code: 3]
G --> I
style E fill:#ff6b6b
style F fill:#51cf66
style C fill:#ffd93d
Output Example
graph LR
subgraph Target
A[OpenClaw Version: 2026.2.12]
B[Gateway: Running]
C[Instance: Local]
end
subgraph ClawJacked
D[VULNERABLE]
E[Version Check: FAIL]
F[Origin Validation: FAIL]
G[Rate Limiting: FAIL]
end
subgraph Remediation
H[openclaw upgrade]
end
A --> D
B --> D
C --> D
D --> E
E --> F
F --> G
G --> H
style D fill:#ff6b6b
style E fill:#ff6b6b
style F fill:#ff6b6b
style G fill:#ff6b6b
style H fill:#51cf66
JSON Output
clawcheck --json
clawcheck --json --output results.json
SARIF Output (CI/CD)
clawcheck --sarif
Verbose Mode
clawcheck -v # Verbose
clawcheck -vv # Extra verbose (includes WebSocket probing)
Fix Mode
# Dry run - see what would be done
clawcheck fix --dry-run
# Apply fix (with confirmation)
clawcheck fix
# Apply fix without confirmation
clawcheck fix --force
Monitoring Mode
# Monitor continuously (60s interval)
clawcheck monitor
# Custom interval
clawcheck monitor --interval 30
# With log file
clawcheck monitor --log-file clawcheck.log
Advanced Options
# Custom timeout
clawcheck --timeout 60
# Custom config path
clawcheck --config-path /custom/path/openclaw.json
# All options combined
clawcheck -vv --json --output scan.json --timeout 60
Exit Codes
flowchart TD
Start[clawcheck scan] --> Check{OpenClaw Found?}
Check -->|No| NotFound[Exit Code: 3]
Check -->|Yes| Scan{Scan Success?}
Scan -->|Error| Error[Exit Code: 2]
Scan -->|Success| Vulnerable{Vulnerabilities Found?}
Vulnerable -->|Yes| VulnExit[Exit Code: 1]
Vulnerable -->|No| Secure[Exit Code: 0]
NotFound --> End[End]
Error --> End
VulnExit --> End
Secure --> End
style NotFound fill:#ffd93d
style Error fill:#ff6b6b
style VulnExit fill:#ff6b6b
style Secure fill:#51cf66
| Code | Meaning | Use Case |
|---|---|---|
| 0 | SECURE | No vulnerabilities found |
| 1 | VULNERABLE | Vulnerabilities detected |
| 2 | ERROR | Scan error (permissions, timeout, etc.) |
| 3 | NOT_FOUND | OpenClaw not installed or not running |
Script Integration Example:
#!/bin/bash
clawcheck --json --output scan.json
EXIT_CODE=$?
case $EXIT_CODE in
0) echo "✓ Secure - no action needed" ;;
1) echo "✗ Vulnerable - apply fix with: clawcheck fix" ;;
2) echo "⚠ Error - check logs" ;;
3) echo "○ OpenClaw not found" ;;
esac
exit $EXIT_CODE
About the Vulnerability
ClawJacked (CVE-2026-CLAW)
Disclosed: February 26, 2026
Severity: HIGH
Affected Versions: OpenClaw < 2026.2.25
Attack Chain
sequenceDiagram
participant Victim as 🧑
participant Website as 🌐
participant Browser as 🌍
participant OpenClaw as 🤖
participant Attacker as 👾
Note over Victim,Attacker: User visits malicious website
Victim->>Website: Visits URL
Website->>Browser: Injects malicious JS
Note over Browser,OpenClaw: Step 1: WebSocket Origin Bypass
Browser->>OpenClaw: WebSocket to localhost:18789
Note right of OpenClaw: No CORS restriction!
OpenClaw-->>Browser: Connection accepted
Note over Browser,OpenClaw: Step 2: No Rate Limiting
loop Brute Force (hundreds/sec)
Browser->>OpenClaw: Auth attempt
OpenClaw-->>Browser: Rejected
end
Note over Browser,OpenClaw: Step 3: Auto-Trust Registration
Browser->>OpenClaw: Successful auth
OpenClaw-->>Browser: Device auto-approved!
Note over OpenClaw,Attacker: Step 4: Full Control
Attacker->>OpenClaw: Send messages, read logs
OpenClaw-->>Attacker: Exfiltrate data
Note over Victim,Attacker: Workstation compromised!
Vulnerability Components
graph TB
subgraph ClawJacked Vulnerability
A[WebSocket Origin Bypass]
B[No Localhost Rate Limiting]
C[Auto Trust Registration]
end
subgraph Attack Consequences
D[Full Workstation Compromise]
E[Data Exfiltration]
F[Privacy Violation]
end
A --> D
B --> D
C --> D
D --> E
D --> F
style A fill:#ff6b6b
style B fill:#ff6b6b
style C fill:#ff6b6b
style D fill:#c92a2a
style E fill:#c92a2a
style F fill:#c92a2a
Impact: Full workstation compromise initiated from a browser tab
Fix: Update to OpenClaw 2026.2.25 or later
Source: Oasis Security Vulnerability Disclosure
Safety & Privacy
- ✅ Offline-capable - No external data transmission
- ✅ Read-only probes - No system modification
- ✅ Rate-limited - 1 request/second (AWS cooperative scanning guidelines)
- ✅ No brute-force - Never attempts password guessing
- ✅ Open source - Fully auditable code
Development
Architecture
flowchart TD
subgraph CLI
A[User]
B[clawcheck command]
end
subgraph Discovery
C[Config Scanner]
D[CLI Runner]
E[Port Prober]
end
subgraph Scan
F[Vulnerability DB]
G[Version Checker]
H[WebSocket Probe]
end
subgraph Output
I[Terminal Formatter]
J[JSON Formatter]
K[SARIF Formatter]
end
subgraph Fix
L[Backup Manager]
M[Update Executor]
N[Verification]
end
A --> B
B --> C
B --> D
B --> E
C --> G
D --> G
G --> F
F --> H
H --> I
H --> J
H --> K
B --> L
L --> M
M --> N
style A fill:#e3f2fd
style B fill:#bbdefb
style I fill:#90caf9
style J fill:#90caf9
style K fill:#90caf9
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run with coverage
pytest --cov=clawcheck --cov-report=html
Project Structure
graph TD
Root[clawcheck/]
Root --> Src[src/]
Root --> Tests[tests/]
Root --> Docs[docs/]
Root --> Config[pyproject.toml, README.md, LICENSE]
Src --> Package[clawcheck/]
Package --> Init[__init__.py]
Package --> CLI[cli.py - Click CLI interface]
Package --> Discovery[discovery.py - OpenClaw discovery]
Package --> Models[models.py - Data models]
Package --> Output[output.py - Output formatters]
Package --> Probe[probe.py - WebSocket probe]
Package --> VulnDB[vuln_db.py - Vulnerability database]
Tests --> Unit[unit/ - Unit tests]
Tests --> Integration[integration/ - Integration tests]
Docs --> Plans[plans/ - Implementation plans]
style Root fill:#e3f2fd
style Src fill:#bbdefb
style Tests fill:#bbdefb
style Docs fill:#bbdefb
style Config fill:#bbdefb
style Package fill:#90caf9
File Overview:
| Module | Purpose |
|---|---|
cli.py |
Click CLI interface (scan/fix/monitor commands) |
discovery.py |
OpenClaw discovery (config, CLI, port probing) |
models.py |
Data models (ScanResult, Finding, ExitCode, etc.) |
output.py |
Terminal/JSON/SARIF formatters |
probe.py |
WebSocket vulnerability probe |
vuln_db.py |
Vulnerability database with version checking |
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run tests and linting
- Submit a pull request
License
MIT License - see LICENSE file for details
Disclaimer
This tool is for security testing purposes only. Always obtain proper authorization before scanning systems. The authors are not responsible for misuse of this software.
Links
Stay secure! 🛡️
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clawcheck-1.0.1.tar.gz.
File metadata
- Download URL: clawcheck-1.0.1.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8dab7059a6d39a992279380372088b611a8ebd3197e168e16578c6903c4a87d
|
|
| MD5 |
557255ec13e1dac7ecd841abdcc19406
|
|
| BLAKE2b-256 |
062e813c6f51626b269af4a7d1cd70a78c0c8615cfacfdf975f00d968f98bf61
|
File details
Details for the file clawcheck-1.0.1-py3-none-any.whl.
File metadata
- Download URL: clawcheck-1.0.1-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c74f37302710c906abd7563ef0476afc0a72e1059f70237039002826358a099
|
|
| MD5 |
bc888073dc61d3be7858f6eb8a2734e0
|
|
| BLAKE2b-256 |
11b856998d92111266cf42b66c96c51901f9b101995d9c550073743f4aa4dada
|