AutoJack Turns Localhost Agent Control Planes Into a Browser-RCE Lesson
Microsoft's AutoJack research showed how untrusted web content rendered by a browsing agent could reach a local AutoGen Studio (Microsoft AutoGen's local interface for building and managing agents) MCP WebSocket route, reach a WebSocket handler with no Origin or authentication check, and supply server parameters that spawn arbitrary processes. Microsoft addressed the issue before PyPI release, but the architecture lesson is broader: localhost is not a security boundary for agent control planes.
Threat Analysis
- The malicious input is ordinary web content. A browsing agent renders an attacker-controlled page while the local agent framework is running.
- The browser can reach localhost. The page opens a WebSocket to the local MCP route, so loopback service exposure becomes part of the attack surface.
- The MCP WebSocket handler lacked its own checks. The affected source accepts the connection without checking its Origin or invoking WebSocket authentication. The application's authentication middleware handles HTTP; its skip list does not exempt
/api/mcp. Reaching localhost does not change the attacker page's Origin. server_paramscrosses into process creation. Base64-decoded parameters supply command and args, turning a browser page into host code execution.- The lesson is control-plane isolation. Agent admin, MCP, browser, and command-execution surfaces must be authenticated, authorized, allowlisted, and sandboxed even when they bind to localhost.
- The patch changes how launch parameters enter the route. Commit
b047730registers parameters server-side throughPOST /api/mcp/ws/connectand lets the WebSocket consume a one-time session ID. HTTP authentication still depends on the deployment configuration; this does not establish universal authentication or network isolation.
Applicable AIDEFEND Defenses (7)
What Defenders Should Do Now
- Inventory agent frameworks that expose localhost HTTP or WebSocket control planes, including MCP routes and developer-only endpoints.
- Require authentication, origin validation, and authorization on every local route, including WebSocket upgrades.
- Deny arbitrary command, browser, and filesystem tool startup from request parameters; use allowlisted execution profiles instead.
- Run browsing agents in isolated browser contexts that cannot access local control planes unless policy explicitly allows it.
- Add regression tests that load attacker-controlled pages and attempt localhost WebSocket, fetch, and redirect access to agent services.
Conclusion
AutoJack connects untrusted web content, an agent browser, a local MCP launch route and host process creation. Verify authentication and Origin checks for the actual WebSocket transport, authorize a bounded launch profile, and enforce browser egress outside the browser process. The admission gate checks evidence of these boundaries; it does not create them. Independently replay the complete route after deploying the fix.
Last updated: