T05 · Unauthorized Access and Privilege Escalation
- Location
docs/troubleshooting.md:126- Finding
Unauthenticated Chrome DevTools Protocol Exposed Through an Unrestricted Firewall Rule
- Content
View full analysis
Vulnerability Details
File Location:
docs/troubleshooting.md:126-140, with related browser startup behavior atenable-browser.sh:83-84
Vulnerability Type: Unrestricted network exposure of an unauthenticated browser-control interface
Risk Level: HighVulnerable Code
docs/troubleshooting.md:126-140:markdown ## ❌ 问题 5:防火墙阻止 **症状:** ```bash # WSL 可以 ping 通 Windows,但 CDP 端口不通 curl http://$WINDOWS_IP:9222/json/version # Connection refused解决:
在 Windows PowerShell(管理员)中执行:
powershell # 添加入站规则 New-NetFirewallRule -DisplayName "Chrome CDP" -Direction Inbound -LocalPort 9222 -Protocol TCP -Action Allowtext Related Chrome launch configuration in `enable-browser.sh:83-84`: ```bash ps_command='Start-Process "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList "--remote-debugging-port=9222","--user-data-dir=C:\Users\$env:USERNAME\AppData\Local\Google\Chrome\Debug","--no-first-run"' $POWERShell -Command "$ps_command"Technical Analysis
The script starts Chrome with the Chrome DevTools Protocol enabled on TCP port 9222. CDP is a privileged browser-control API and does not provide an authentication mechanism of its own.
The troubleshooting guide instructs administrators to create an inbound Windows Firewall rule that permits TCP connections to port 9222. The rule does not specify
RemoteAddress,InterfaceAlias, orProfile, so it is not restricted to the WSL virtual network, localhost, or another trusted source.If Chrome's debugging endpoint becomes reachable through a non-loopback interface, local forwarding, or the Windows networking configuration, any host able to connect to port 9222 can query CDP discovery endpoints such as
/json/versionand/json/list. Those endpoints can disclose WebSocket debugger URLs through which the browser can be controlled.Although the script uses a dedicated debugging profile rather than the ...[truncated 1759 chars]
- Remediation
View remediation
Remediation Suggestions
-
Do not create a firewall rule allowing arbitrary remote addresses to reach CDP.
-
Keep the CDP listener bound to loopback whenever the WSL configuration supports loopback forwarding.
-
If a firewall exception is unavoidable, restrict it to the specific WSL virtual-network address range or exact source address:
powershell New-NetFirewallRule ` -DisplayName "Chrome CDP from WSL only" ` -Direction Inbound ` -Protocol TCP ` -LocalPort 9222 ` -RemoteAddress "<trusted-WSL-address-or-subnet>" ` -Profile Private ` -Action Allow -
Restrict the rule to the appropriate interface and firewall profile where possible.
-
Continue using a dedicated, empty Chrome profile and avoid authenticating sensitive accounts in it.
-
Remove the firewall rule when browser automation is no longer required.
-
Add a prominent warning that CDP is unauthenticated and must not be exposed to untrusted networks.
-
Consider a protected local forwarding mechanism instead of directly exposing port 9222.
-
