T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:34
- Finding
- Wildcard CDP WebSocket Origin Allowlist Exposes Authenticated Browser Sessions## Vulnerability Details **File Location**: `SKILL.md:34-43` **Additional Location**: `测试报告.md:163-183` **Vulnerability Type**: Unsafe Chrome DevTools Protocol configuration **Risk Level**: High ### Vulnerable Code ```bash chrome.exe --remote-debugging-port=9222 --remote-allow-origins=* --user-data-dir="C:\chrome-profile" ``` ```bash /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \ --remote-debugging-port=9222 --remote-allow-origins=* \ --user-data-dir="/tmp/chrome-profile" ``` ### Technical Analysis The documented `--remote-allow-origins=*` option instructs Chrome to accept CDP WebSocket connections from every origin. This disables an origin-based security control that would otherwise reject unauthorized WebSocket clients. CDP provides extensive control over the attached browser, including: - Executing arbitrary JavaScript in pages through `Runtime.evaluate` - Reading page content and DOM state - Navigating tabs and submitting forms - Simulating mouse and keyboard input - Capturing screenshots - Performing actions through existing authenticated sessions The Skill explicitly promotes reuse of logged-in browser profiles, cookies, login state, and background permissions. Consequently, weakening CDP origin validation can expose substantially more than an isolated automation tab. A wildcard origin is not required for the declared browser-automation functionality. The specific trusted automation origin can be allowlisted instead. The test report confirms that Chrome originally returned HTTP 403 because of its origin protection and that the wildcard option was presented as the workaround. ### Attack Path 1. A user follows the Skill documentation and starts Chrome with remote debugging and `--remote-allow-origins=*`. 2. The browser uses a persistent profile containing authenticated website sessions. 3. The user opens attacker-controlled content, or an untrusted local client gains ...[truncated 1435 chars]
- Remediation
- ## Remediation Suggestions 1. Replace the wildcard with the exact trusted automation origin: ```bash --remote-allow-origins=http://127.0.0.1:18800 ``` The permitted origin must match the actual trusted client configuration. 2. Ensure the debugging service listens only on loopback: ```bash --remote-debugging-address=127.0.0.1 ``` 3. Use a dedicated automation profile that does not contain personal browsing sessions or unrelated authenticated accounts. 4. Do not load untrusted websites while the debugging interface is active. 5. Shut down the debugging browser immediately after the automation task completes. 6. Update `SKILL.md` and `测试报告.md` to remove the wildcard recommendation and explain the risks of exposing an authenticated profile through CDP. 7. Prefer the OpenClaw browser integration when it provides authenticated and origin-restricted CDP access without disabling Chrome's protection globally.
