# AutoJack: AutoGen Studio MCP WebSocket RCE Chain (localhost origin trust + unauthenticated /api/mcp endpoint + base64 server_params command injection)

> AutoJack is a remote-code-execution exploit chain in Microsoft AutoGen Studio that lets a single attacker-controlled web page, rendered by a local browsing agent, reach the privileged MCP WebSocket control plane on localhost and spawn arbitrary host processes under the developer's account. Microsoft demonstrated a proof-of-concept launching Windows Calculator. The chain was fixed on the GitHub main branch at commit b047730 (PR #7362) before shipping in a stable PyPI release.

- **Published:** 2026-06-22T00:00:00Z
- **Last reviewed:** 2026-06-22T00:00:00Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-0904
- **Card image:** https://intel.threadlinqs.com/og/threat/threat-intel-autojack-localhost-mcp-websocket-rce-tl-2026-0904.webp?v=263c7327 (Threadlinqs threat intel: AutoJack AutoGen Studio MCP RCE: Detection & IOCs (TL-2026-0904) — High severity, 16 IOCs, 9 detection rules.)
- **ID:** TL-2026-0904
- **Severity:** HIGH
- **Category:** VULNERABILITY
- **Status:** PATCHED
- **Detections:** 9 (1 shown free below) · **IOCs:** 16 (1 shown free below)

## Description

AutoJack is a three-flaw exploit chain in AutoGen Studio (the open-source prototyping UI for Microsoft's AutoGen multi-agent framework, 59,000+ GitHub stars) that converts a single malicious web page into full remote code execution on the host running the agent. The root cause is that AutoGen Studio's MCP (Model Context Protocol) WebSocket control plane treats 'localhost' as a trust boundary, but a browsing agent (MultimodalWebSurfer, fetch_webpage_tool, or other Playwright-backed surfers) executes on the same machine — so any JavaScript the agent loads from an attacker page inherits the localhost origin identity.

The chain links three distinct weaknesses. (1) Origin allowlist bypass (CWE-1385): the WebSocket validated Origin against an allowlist of ["http://127.0.0.1", "http://localhost"], a check designed to block remote browsers but trivially satisfied by an in-host agent browser, letting attacker JavaScript open ws://localhost:8081/api/mcp/ws/ connections that pass the origin check. (2) Authentication bypass (CWE-306): the authentication middleware short-circuited any path starting with /api/ws or /api/mcp ('if request.url.path.startswith("/api/ws") or request.url.path.startswith("/api/mcp"): return await call_next(request)'), delegating credential validation to the MCP handler, which never implemented it — leaving /api/mcp/ws/* unauthenticated under every auth mode (none, github, msal, firebase). (3) Command injection (CWE-78): the WebSocket handler read a base64-encoded 'server_params' query parameter, base64-decoded it, deserialized it into StdioServerParams, and passed it to stdio_client(), with no allowlist on the spawned executable — so a payload such as {"type":"StdioServerParams","command":"calc.exe","args":[],"env":{"pwned":"true"}} (or powershell.exe -enc / bash -c) was accepted as a 'MCP server' and executed.

End-to-end attack flow: a developer runs AutoGen Studio on localhost:8081 with a browsing agent; the agent is fed an attacker-controlled URL (via direct user submission, indirect/prompt injection, or a malicious comment); MultimodalWebSurfer navigates a headless browser to the attacker page; the page's JavaScript opens ws://localhost:8081/api/mcp/ws/?server_params=<base64payload>; the origin check passes (localhost-to-localhost) and the auth check is skipped; the payload is decoded and stdio_client() spawns the attacker-specified process under the developer's account. Microsoft's PoC ('malicious_web_server.py' serving the script payload, and a Flask-wrapped 'web_summarizer_app.py' Web Content Summarizer agent) showed calc.exe spawning on the developer desktop as a child of the AutoGen Studio Python process — not the browser, not the agent sandbox.

Remediation (commit b047730, PR #7362): the WebSocket handler no longer reads server_params from the URL. A new POST /api/mcp/ws/connect endpoint stores parameters server-side in a pending_session_params map keyed by a server-generated UUID; the WebSocket handler pops the entry by session ID and refuses unknown IDs with WebSocket close code 4004. The middleware skip-list was tightened to remove /api/mcp, so MCP routes now flow through normal authentication. Microsoft states the vulnerable MCP WebSocket surface was fixed before a stable PyPI release; the standard 'pip install autogenstudio' installs 0.4.2.2, which lacks the MCP WebSocket route (autogenstudio/web/routes/mcp.py) entirely. Reporting attributes the research to Shaked Ilan of Microsoft Defender Security Research with Microsoft Threat Intelligence, coordinated via MSRC; no in-the-wild exploitation was reported. The broader lesson — 'localhost is not a trust boundary' — applies to any agent framework that exposes a privileged local control plane reachable by in-host browsing agents.

## MITRE ATT&CK

- T1190 Exploit Public-Facing Application
- T1189 Drive-by Compromise
- T1203 Exploitation for Client Execution
- T1059 Command and Scripting Interpreter
- T1204 User Execution
- T1106 Native API
- T1027 Obfuscated Files or Information
- T1140 Deobfuscate/Decode Files or Information
- T1550 Use Alternate Authentication Material
- T1539 Steal Web Session Cookie
- T1185 Browser Session Hijacking
- T1071 Application Layer Protocol
- T1021 Remote Services

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**AutoJack — AutoGen Studio Python Parent Spawning Unexpected Child Process (Post-Exploitation RCE Artifact)** (`TL-2026-0904-SPL-002`)

Detects the core AutoJack RCE artifact on Windows: the AutoGen Studio control-plane process (python.exe / pythonw.exe / autogenstudio.exe) spawning an unexpected interactive child — calc.exe (Microsoft PoC), powershell.exe, cmd.exe, or CalculatorApp.exe — as a child of the control plane rather than the browser or agent sandbox. This is the highest-fidelity post-exploitation signal because legitimate AutoGen Studio rarely launches interactive shells.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1203, T1059.003, T1059.001, T1106
- **Data sources:** sysmon, windows_security, microsoft_defender_endpoint
- **Severity:** critical
- **Confidence:** high

### Splunk SPL

```spl
index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
| eval ParentImageL=lower(ParentImage), ImageL=lower(Image)
| where (like(ParentImageL,"%\\python.exe") OR like(ParentImageL,"%\\pythonw.exe") OR like(ParentImageL,"%autogenstudio%"))
| where (like(ImageL,"%\\calc.exe") OR like(ImageL,"%\\calculatorapp.exe") OR like(ImageL,"%\\powershell.exe") OR like(ImageL,"%\\cmd.exe") OR like(ImageL,"%\\pwsh.exe") OR like(ImageL,"%\\bash.exe") OR like(ImageL,"%\\wscript.exe") OR like(ImageL,"%\\mshta.exe"))
| eval autogen_context=if(match(lower(ParentCommandLine),"autogenstudio|autogen"),"yes","no")
| stats count min(_time) as firstTime max(_time) as lastTime values(Image) as child_images values(CommandLine) as child_cmdlines by host ParentImage ParentProcessId autogen_context
| `ctime(firstTime)` | `ctime(lastTime)`
| sort - count
```

### Microsoft KQL

```kql
DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ ("python.exe", "pythonw.exe", "autogenstudio.exe")
    or InitiatingProcessCommandLine has "autogenstudio"
| where FileName in~ ("calc.exe", "CalculatorApp.exe", "powershell.exe", "pwsh.exe", "cmd.exe", "bash.exe", "wscript.exe", "mshta.exe")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessId, InitiatingProcessCommandLine, FileName, ProcessCommandLine
| sort by Timestamp desc
```

### Sigma

```yaml
title: AutoGen Studio Parent Spawning Unexpected Child Process (AutoJack RCE)
id: 4f1a8c2e-0904-4a02-9b11-3c7e5a1d0002
status: experimental
description: Detects the AutoJack post-exploitation artifact — an AutoGen Studio control-plane Python process spawning an unexpected interactive child (calc.exe/powershell/cmd), the signature of server_params command injection reaching stdio_client().
references:
    - https://www.microsoft.com/en-us/security/blog/2026/06/18/autojack-single-page-rce-host-running-ai-agent/
author: Threadlinqs Team
date: 2026/06/22
tags:
    - attack.execution
    - attack.t1203
    - attack.t1059.003
    - attack.t1106
logsource:
    product: windows
    category: process_creation
detection:
    selection_parent:
        ParentImage|endswith:
            - '\python.exe'
            - '\pythonw.exe'
            - '\autogenstudio.exe'
    selection_child:
        Image|endswith:
            - '\calc.exe'
            - '\CalculatorApp.exe'
            - '\powershell.exe'
            - '\cmd.exe'
            - '\bash.exe'
    condition: selection_parent and selection_child
falsepositives:
    - Developer manually launching a shell from a Python IDE/terminal subprocess
level: high
```

**Known false positives:**

- Developers intentionally spawning a shell from a Python-based tool or notebook
- Legitimate AutoGen agents configured to run a sanctioned local MCP/stdio server executable

**Tuning notes:** Allowlist sanctioned MCP/stdio server executables that AutoGen is legitimately configured to launch. Treat calc.exe/CalculatorApp.exe children of python as near-certain AutoJack PoC and escalate immediately. Add EDR enrichment to confirm the grandparent is the AutoGen Studio service.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- AutoJack — Unauthenticated MCP WebSocket /api/mcp/ws Reached on Loopback (Exploitation) (locked: unlock with TL Creds)
- AutoJack — Base64 StdioServerParams Decode Followed by PowerShell Encoded-Command Launch (Post-Exploitation) (locked: unlock with TL Creds)
- AutoJack — AutoGen Studio Control Plane Bound to Non-Loopback (Exposure / Lateral-Movement Enabler) (locked: unlock with TL Creds)
- AutoJack — Malicious Page server_params WebSocket Payload (Exploitation, Sigma-primary) (locked: unlock with TL Creds)
- AutoJack — AutoGen Studio Parent Spawning Shell on Linux (Post-Exploitation, Sigma-primary) (locked: unlock with TL Creds)
- AutoJack — Base64 StdioServerParams Decode-to-Spawn Sequence (C2 / Deobfuscation, Sigma-primary) (locked: unlock with TL Creds)
- AutoJack — MCP WebSocket server_params Command-Injection URL (Exploitation) (locked: unlock with TL Creds)
- AutoJack — Browsing Agent to Untrusted Domain Preceding Local Child Process (C2 / Drive-by Chain) (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (1 of 16)

Defanged, TLP:CLEAR.

- Domain: `attacker[.]example`

Full set of 16 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [AutoJack: How a single page can RCE the host running your AI agent](https://www.microsoft.com/en-us/security/blog/2026/06/18/autojack-single-page-rce-host-running-ai-agent/)
- [Microsoft fixes AutoGen Studio flaw that enabled code execution](https://www.bleepingcomputer.com/news/security/microsoft-fixes-autogen-studio-flaw-that-enabled-code-execution/)
- [AutoJack Attack Lets One Web Page Hijack AI Agent for Host Code Execution](https://thehackernews.com/2026/06/autojack-attack-lets-one-web-page.html)
- [AutoJack Exploit Chain Hits Microsoft AutoGen Studio With Zero-Click RCE Attack](https://gbhackers.com/autojack-exploit-chain-hits-microsoft-autogen/)
- [AutoJack - A Single Web Page Can Hijack Your AI Agent to Execute Malicious Code](https://cybersecuritynews.com/autojack/)
- [AutoJack AI Agent RCE: Localhost Is Not a Trust Boundary](https://www.penligent.ai/hackinglabs/autojack-ai-agent-rce/)
- [AutoGen Studio MCP WebSocket hardening (PR #7362, commit b047730)](https://github.com/microsoft/autogen/pull/7362)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-0904
