clawcheck 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,147 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ PIPFILE.lock
28
+
29
+ # PyInstaller
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+ cover/
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Django stuff:
57
+ *.log
58
+ local_settings.py
59
+ db.sqlite3
60
+ db.sqlite3-journal
61
+
62
+ # Flask stuff:
63
+ instance/
64
+ .webassets-cache
65
+
66
+ # Scrapy stuff:
67
+ .scrapy
68
+
69
+ # Sphinx documentation
70
+ docs/_build/
71
+
72
+ # PyBuilder
73
+ .pybuilder/
74
+ target/
75
+
76
+ # Jupyter Notebook
77
+ .ipynb_checkpoints
78
+
79
+ # IPython
80
+ profile_default/
81
+ ipython_config.py
82
+
83
+ # pyenv
84
+ .python-version
85
+
86
+ # pipenv
87
+ Pipfile.lock
88
+
89
+ # poetry
90
+ poetry.lock
91
+
92
+ # pdm
93
+ .pdm.toml
94
+
95
+ # PEP 582
96
+ __pypackages__/
97
+
98
+ # Celery stuff
99
+ celerybeat-schedule
100
+ celerybeat.pid
101
+
102
+ # SageMath parsed files
103
+ *.sage.py
104
+
105
+ # Environments
106
+ .env
107
+ .venv
108
+ env/
109
+ venv/
110
+ ENV/
111
+ env.bak/
112
+ venv.bak/
113
+
114
+ # Spyder project settings
115
+ .spyderproject
116
+ .spyproject
117
+
118
+ # Rope project settings
119
+ .ropeproject
120
+
121
+ # mkdocs documentation
122
+ /site
123
+
124
+ # mypy
125
+ .mypy_cache/
126
+ .dmypy.json
127
+ dmypy.json
128
+
129
+ # Pyre type checker
130
+ .pyre/
131
+
132
+ # pytype static type analyzer
133
+ .pytype/
134
+
135
+ # Cython debug symbols
136
+ cython_debug/
137
+
138
+ # IDE
139
+ .vscode/
140
+ .idea/
141
+ *.swp
142
+ *.swo
143
+ *~
144
+
145
+ # OS
146
+ .DS_Store
147
+ Thumbs.db
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ClawCheck Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,310 @@
1
+ Metadata-Version: 2.4
2
+ Name: clawcheck
3
+ Version: 1.0.0
4
+ Summary: OpenClaw vulnerability scanner - Detect ClawJacked (CVE-2026-CLAW)
5
+ Project-URL: Homepage, https://github.com/yourusername/clawcheck
6
+ Project-URL: Documentation, https://github.com/yourusername/clawcheck#readme
7
+ Project-URL: Repository, https://github.com/yourusername/clawcheck
8
+ Project-URL: Issues, https://github.com/yourusername/clawcheck/issues
9
+ Author: ClawCheck Contributors
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: cli,openclaw,scanner,security,vulnerability
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: System Administrators
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Security
23
+ Classifier: Topic :: System :: Systems Administration
24
+ Requires-Python: >=3.10
25
+ Requires-Dist: click>=8.1.0
26
+ Requires-Dist: httpx>=0.27.0
27
+ Requires-Dist: pydantic>=2.0.0
28
+ Requires-Dist: rich>=13.0.0
29
+ Requires-Dist: websockets>=12.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: black>=23.0.0; extra == 'dev'
32
+ Requires-Dist: mypy>=1.7.0; extra == 'dev'
33
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
34
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
35
+ Requires-Dist: pytest>=7.4.0; extra == 'dev'
36
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
37
+ Description-Content-Type: text/markdown
38
+
39
+ # ClawCheck
40
+
41
+ <div align="center">
42
+
43
+ **🛡️ OpenClaw Vulnerability Scanner**
44
+
45
+ Detect the **ClawJacked** vulnerability (CVE-2026-CLAW) in OpenClaw installations
46
+
47
+ [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
48
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
49
+
50
+ </div>
51
+
52
+ ## Quick Start
53
+
54
+ ```bash
55
+ pip install clawcheck
56
+ clawcheck
57
+ ```
58
+
59
+ ## Overview
60
+
61
+ **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.
62
+
63
+ **What it does:**
64
+ - ✅ Scans for OpenClaw installations
65
+ - ✅ Checks version against vulnerable range (`< 2026.2.25`)
66
+ - ✅ Probes WebSocket gateway for security indicators
67
+ - ✅ Provides remediation guidance
68
+ - ✅ CI/CD integration (JSON/SARIF output)
69
+
70
+ **What it doesn't do:**
71
+ - ❌ No external data transmission (offline-capable)
72
+ - ❌ No brute-force attacks (read-only probes)
73
+ - ❌ No system modifications (in scan mode)
74
+
75
+ ## Installation
76
+
77
+ ### pip (Recommended)
78
+
79
+ ```bash
80
+ pip install clawcheck
81
+ ```
82
+
83
+ ### pipx (Isolated Installation)
84
+
85
+ ```bash
86
+ pipx install clawcheck
87
+ ```
88
+
89
+ ### From Source
90
+
91
+ ```bash
92
+ git clone https://github.com/yourusername/clawcheck.git
93
+ cd clawcheck
94
+ pip install -e .
95
+ ```
96
+
97
+ ## Usage
98
+
99
+ ### Basic Scan
100
+
101
+ ```bash
102
+ clawcheck
103
+ ```
104
+
105
+ Example output:
106
+ ```
107
+ ✗ VULNERABLE: 1 vulnerability(ies) found
108
+
109
+ ┏━━━━━━━━━━━━━━━━ Target Information ━━━━━━━━━━━━━━━━┓
110
+ ┃ ┃
111
+ ┃ OpenClaw Version 2026.2.12 ┃
112
+ ┃ Gateway Status Running ┃
113
+ ┃ Config Path /Users/user/.openclaw/... ┃
114
+ ┃ Instance Type local ┃
115
+ ┃ ┃
116
+ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
117
+
118
+ ┏━━━━━━━━━━ CLAWJACKED ━━━━━━━━━━━━ VULNERABLE ━━━━━━━━━━━┓
119
+ ┃ WebSocket hijacking via localhost origin bypass ┃
120
+ ┃ ┃
121
+ ┃ Indicator Status ┃
122
+ ┃ ────────── ────── ┃
123
+ ┃ Version Check VULNERABLE ┃
124
+ ┃ Origin Validation FAIL ┃
125
+ ┃ Rate Limiting FAIL ┃
126
+ ┃ Trust Registration FAIL ┃
127
+ ┃ ┃
128
+ ┃ Auto-fix: openclaw upgrade ┃
129
+ ┃ Manual steps: ┃
130
+ ┃ • Update to OpenClaw 2026.2.25 or later ┃
131
+ ┃ • Verify gateway configuration... ┃
132
+ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
133
+ ```
134
+
135
+ ### JSON Output
136
+
137
+ ```bash
138
+ clawcheck --json
139
+ clawcheck --json --output results.json
140
+ ```
141
+
142
+ ### SARIF Output (CI/CD)
143
+
144
+ ```bash
145
+ clawcheck --sarif
146
+ ```
147
+
148
+ ### Verbose Mode
149
+
150
+ ```bash
151
+ clawcheck -v # Verbose
152
+ clawcheck -vv # Extra verbose (includes WebSocket probing)
153
+ ```
154
+
155
+ ### Fix Mode
156
+
157
+ ```bash
158
+ # Dry run - see what would be done
159
+ clawcheck fix --dry-run
160
+
161
+ # Apply fix (with confirmation)
162
+ clawcheck fix
163
+
164
+ # Apply fix without confirmation
165
+ clawcheck fix --force
166
+ ```
167
+
168
+ ### Monitoring Mode
169
+
170
+ ```bash
171
+ # Monitor continuously (60s interval)
172
+ clawcheck monitor
173
+
174
+ # Custom interval
175
+ clawcheck monitor --interval 30
176
+
177
+ # With log file
178
+ clawcheck monitor --log-file clawcheck.log
179
+ ```
180
+
181
+ ### Advanced Options
182
+
183
+ ```bash
184
+ # Custom timeout
185
+ clawcheck --timeout 60
186
+
187
+ # Custom config path
188
+ clawcheck --config-path /custom/path/openclaw.json
189
+
190
+ # All options combined
191
+ clawcheck -vv --json --output scan.json --timeout 60
192
+ ```
193
+
194
+ ## Exit Codes
195
+
196
+ | Code | Meaning | Use Case |
197
+ |------|---------|----------|
198
+ | 0 | SECURE | No vulnerabilities found |
199
+ | 1 | VULNERABLE | Vulnerabilities detected |
200
+ | 2 | ERROR | Scan error (permissions, timeout, etc.) |
201
+ | 3 | NOT_FOUND | OpenClaw not installed or not running |
202
+
203
+ **Script Integration Example:**
204
+
205
+ ```bash
206
+ #!/bin/bash
207
+ clawcheck --json --output scan.json
208
+ EXIT_CODE=$?
209
+
210
+ case $EXIT_CODE in
211
+ 0) echo "✓ Secure - no action needed" ;;
212
+ 1) echo "✗ Vulnerable - apply fix with: clawcheck fix" ;;
213
+ 2) echo "⚠ Error - check logs" ;;
214
+ 3) echo "○ OpenClaw not found" ;;
215
+ esac
216
+
217
+ exit $EXIT_CODE
218
+ ```
219
+
220
+ ## About the Vulnerability
221
+
222
+ ### ClawJacked (CVE-2026-CLAW)
223
+
224
+ **Disclosed:** February 26, 2026
225
+ **Severity:** HIGH
226
+ **Affected Versions:** OpenClaw `< 2026.2.25`
227
+
228
+ **Attack Vector:**
229
+
230
+ 1. **WebSocket Origin Bypass** - Malicious JavaScript can connect to `localhost:18789` without CORS restrictions
231
+ 2. **No Localhost Rate Limiting** - Brute-force attacks at hundreds of attempts per second
232
+ 3. **Automatic Trust Registration** - Successful auth from localhost auto-approves device pairing
233
+
234
+ **Impact:** Full workstation compromise initiated from a browser tab
235
+
236
+ **Fix:** Update to OpenClaw `2026.2.25` or later
237
+
238
+ **Source:** [Oasis Security Vulnerability Disclosure](https://www.oasis.security/blog/openclaw-vulnerability)
239
+
240
+ ## Safety & Privacy
241
+
242
+ - ✅ **Offline-capable** - No external data transmission
243
+ - ✅ **Read-only probes** - No system modification
244
+ - ✅ **Rate-limited** - 1 request/second (AWS cooperative scanning guidelines)
245
+ - ✅ **No brute-force** - Never attempts password guessing
246
+ - ✅ **Open source** - Fully auditable code
247
+
248
+ ## Development
249
+
250
+ ### Running Tests
251
+
252
+ ```bash
253
+ # Install dev dependencies
254
+ pip install -e ".[dev]"
255
+
256
+ # Run tests
257
+ pytest
258
+
259
+ # Run with coverage
260
+ pytest --cov=clawcheck --cov-report=html
261
+ ```
262
+
263
+ ### Project Structure
264
+
265
+ ```
266
+ clawcheck/
267
+ ├── src/clawcheck/
268
+ │ ├── __init__.py
269
+ │ ├── cli.py # Click CLI interface
270
+ │ ├── discovery.py # OpenClaw discovery
271
+ │ ├── models.py # Data models
272
+ │ ├── output.py # Output formatters
273
+ │ ├── probe.py # WebSocket vulnerability probe
274
+ │ └── vuln_db.py # Vulnerability database
275
+ ├── tests/
276
+ │ ├── unit/ # Unit tests
277
+ │ └── integration/ # Integration tests
278
+ ├── docs/ # Documentation
279
+ ├── pyproject.toml
280
+ └── README.md
281
+ ```
282
+
283
+ ## Contributing
284
+
285
+ Contributions are welcome! Please:
286
+
287
+ 1. Fork the repository
288
+ 2. Create a feature branch
289
+ 3. Make your changes
290
+ 4. Add tests for new functionality
291
+ 5. Run tests and linting
292
+ 6. Submit a pull request
293
+
294
+ ## License
295
+
296
+ MIT License - see LICENSE file for details
297
+
298
+ ## Disclaimer
299
+
300
+ 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.
301
+
302
+ ## Links
303
+
304
+ - [Oasis Security: ClawJacked Vulnerability](https://www.oasis.security/blog/openclaw-vulnerability)
305
+ - [OpenClaw Repository](https://github.com/openclaw/openclaw)
306
+ - [SARIF v2.1.0 Specification](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html)
307
+
308
+ ---
309
+
310
+ **Stay secure! 🛡️**