Skip to content
RCE Write-up Advanced

AutoJack: A single page can RCE the host running your AI agent

AutoGen Studio's MCP WebSocket accepted unauthenticated connections from any localhost origin and executed a base64-encoded server_params query parameter as an OS command. An attacker could get a browsing agent to render a malicious page, which then opened a WebSocket to localhost and spawned arbitrary processes on the host.

microsoft.com

Published on microsoft.com

Ongoing research into AI agent framework security identified an exploit chain in AutoGen Studio (AutoGen’s open-source prototyping user interface) that allows untrusted web content rendered by a browsing agent to reach a local Model Context Protocol (MCP) WebSocket and spawn arbitrary processes on the host. The…

Microsoft Defender Security Research Team, on microsoft.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the combination of an origin allowlist that trusts localhost, authentication middleware that skipped MCP paths, and a WebSocket handler that executed a base64-encoded server_params query parameter as an OS command without validation.

Impact

An attacker could execute arbitrary commands on the host running AutoGen Studio under the developer's account, but the affected code was never included in a PyPI release, so only developers building from the main branch were exposed.

What the attacker needed

AutoGen Studio built from main branch; Agent with browsing capability on same host; Attacker-controlled URL rendered by agent

The fix

The issue was fixed by binding server parameters server-side via a separate POST route keyed by UUID and by removing /api/mcp from the authentication middleware skip list.

How it was found

  1. The developer runs AutoGen Studio on localhost:8081 and uses an agent with browsing capabilities.
  2. The attacker provides a URL to the agent, either directly or via a planted comment or prompt injection.
  3. The agent's browsing tool navigates to the attacker's page.
  4. The page's JavaScript opens a WebSocket to the local MCP endpoint with a base64-encoded server_params payload.
  5. AutoGen Studio decodes the payload and spawns the attacker-supplied command under the developer's account.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

AutoGen Studio is a tool for building AI agents. It had a WebSocket (a two-way connection) that only checked the connection came from the same computer, not that the caller was allowed to use it. It also took a command from the web address and ran it, so a malicious web page opened by an AI agent could run any program on the developer's machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.