T09 · Insecure Skill Coding Practices
- Location
scripts/ima.py:68- Finding
Privileged CDP Endpoint Allows Connections from Unrestricted Origins
- Content
View full analysis
Vulnerability Details
File Location:
scripts/ima.py, lines 68-69
Vulnerability Type: Exposed privileged debugging interface
Risk Level: HighVulnerable Code
python subprocess.Popen([APP_PATH, f"--remote-debugging-port={CDP_PORT}", "--remote-allow-origins=*"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)Technical Analysis
The Skill launches IMA.copilot with the Chrome DevTools Protocol enabled on port 8315 and explicitly configures
--remote-allow-origins=*.CDP is a privileged browser-control interface. A connected client can navigate pages, execute JavaScript, inspect the DOM, monitor or modify network requests, and access data available to the application session. The wildcard origin option removes origin-based WebSocket restrictions that would otherwise limit connections to the debugging service.
Although the configured host is loopback, the endpoint has no application-level authentication. Other local processes—and potentially malicious web content capable of reaching the local service—may attempt to discover debugging targets through the CDP HTTP endpoints and connect to their WebSocket debugger URLs while the Skill is running.
Attack Path
- A user invokes the Skill.
- The Skill starts IMA.copilot with remote debugging enabled on port 8315.
- The wildcard origin option permits WebSocket connections regardless of their declared origin.
- An attacker-controlled local process, or web content able to access the loopback service, queries a CDP discovery endpoint such as
/jsonor/json/version. - The attacker retrieves a target's
webSocketDebuggerUrl. - The attacker connects to that URL and submits privileged CDP commands.
- Those commands can inspect or manipulate IMA pages, network activity, and data rendered in the authenticated application session.
Impact Assessment
Successful exploitation can provide control over the IMA bro ...[truncated 596 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
--remote-allow-origins=*and retain the browser's restrictive origin checks. - Use a randomly selected ephemeral loopback port instead of the fixed port 8315.
- Ensure the debugging endpoint binds exclusively to the loopback interface.
- Launch automation in a dedicated temporary browser profile that does not share unrelated authentication or browsing data.
- Track the exact process started by the Skill and terminate it immediately after the operation completes.
- Reject connections to an already-open port unless the process and debugging target can be positively verified as the expected IMA instance.
- Minimize the lifetime of the CDP connection and disable network interception as soon as it is no longer required.
- Where supported, use an authenticated or pipe-based automation transport rather than an unauthenticated TCP debugging endpoint.
- Remove
