T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/yumweb.py:347
- Finding
- Authenticated Browser Exposed Through Unrestricted CDP Origins<![CDATA[ ## Vulnerability Details **File Location**: `scripts/yumweb.py:347-355` **Vulnerability Type**: Unrestricted Chrome DevTools Protocol access **Risk Level**: High ### Vulnerable Code ```python args = [ edge, f"--remote-debugging-port={port}", f"--user-data-dir={profile}", "--no-first-run", "--no-default-browser-check", "--disable-features=msEdgeFirstRunExperience", "--remote-allow-origins=*", "about:blank", ] ``` ### Technical Analysis The browser is started with Chrome DevTools Protocol enabled and with `--remote-allow-origins=*`. This wildcard allows WebSocket upgrade requests from arbitrary origins instead of limiting CDP clients to trusted origins. CDP grants extensive control over the browser, including reading page content, executing JavaScript, navigating tabs, submitting forms, and interacting with authenticated sessions. This is particularly sensitive because yumweb deliberately uses a persistent browser profile containing login cookies. The launch arguments do not explicitly include `--remote-debugging-address=127.0.0.1`. Although current Chromium implementations normally bind remote debugging to loopback by default, relying on an implicit default is weaker than enforcing the intended network boundary explicitly. ### Attack Path 1. The user starts yumweb and logs into sensitive websites using its persistent browser profile. 2. Chromium exposes CDP on port 9333 with arbitrary WebSocket origins allowed. 3. A hostile local process, or a malicious origin capable of discovering and reaching the local endpoint, attempts to connect to the CDP service. 4. The wildcard origin setting permits the WebSocket origin. 5. The attacker uses CDP methods to inspect authenticated pages, execute JavaScript, navigate tabs, submit actions, or extract sensitive page data. Exploitation depends on the attacker being able to reach or discover the local CDP endpoint. If the endpoint becomes accessible beyond loopback because of ...[truncated 784 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the unrestricted origin option: ```python "--remote-allow-origins=*", ``` 2. Explicitly enforce loopback binding: ```python f"--remote-debugging-address=127.0.0.1", f"--remote-debugging-port={port}", ``` 3. Use an unpredictable, dynamically allocated port where practical instead of a fixed port. 4. Verify after startup that the CDP socket is bound exclusively to loopback; terminate the browser if this verification fails. 5. Isolate the browser process from untrusted local users and containers. 6. Consider an authenticated local proxy or OS-protected IPC mechanism rather than exposing CDP directly. 7. Warn users that any process capable of connecting to CDP can effectively control authenticated browser sessions. ]]>
