T09 · Insecure Skill Coding Practices
- Location
scripts/run_hourly_growth.py:141- Finding
Authenticated Chrome Profile Exposed Through Overly Permissive CDP Origins
- Content
View full analysis
Vulnerability Details
File Location:
scripts/run_hourly_growth.py, lines 141-161
Vulnerability Type: Overly permissive browser remote-debugging configuration
Risk Level: Highpython # Restart only the OpenClaw profile Chrome so normal personal Chrome windows are left alone. subprocess.run(["pkill", "-f", str(PROFILE_DIR)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) time.sleep(2) for name in ("SingletonLock", "SingletonSocket", "SingletonCookie"): try: (PROFILE_DIR / name).unlink() except FileNotFoundError: pass args = [ "open", "-na", "Google Chrome", "--args", f"--remote-debugging-port={port}", f"--user-data-dir={PROFILE_DIR}", "--remote-allow-origins=*", "--no-first-run", "--no-default-browser-check", "https://x.com/home", ] subprocess.Popen(args, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)Technical Analysis
The script starts Chrome with remote debugging enabled against a persistent OpenClaw browser profile that may contain authenticated sessions. The
--remote-allow-origins=*option disables Chrome DevTools Protocol WebSocket origin restrictions for every origin.This is broader than required for the declared functionality. The CDP client already attempts explicit localhost origins, so globally permitting all origins unnecessarily weakens a security boundary. Any malicious local process—and, depending on browser and network conditions, potentially attacker-controlled web content capable of reaching the debugging endpoint—could attempt to establish a DevTools connection.
A successful CDP connection provides powerful browser-control capabilities, including inspecting page content, evaluating JavaScript in authenticated tabs, navigating pages, and performing actions with the user's active browser sessions.
Attack Path
- The user invokes the Skill and the existing CDP connection attempt fails ...[truncated 1316 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
--remote-allow-origins=*. - If an origin override is genuinely required, permit only the exact trusted loopback origin used by the CDP client.
- Explicitly bind the remote-debugging service to the loopback interface and verify that it is not accessible from external interfaces.
- Use a dedicated browser profile containing only the minimum authentication state needed for X.
- Do not keep unrelated authenticated services open in the automation profile.
- Fail safely if a secure CDP connection cannot be established instead of automatically weakening WebSocket origin protections.
- Consider using a temporary automation profile and importing only narrowly scoped session state where operationally feasible.
- Validate that the requested debugging port is local, available, and within an expected range before launching Chrome.
- Remove
