Windows-MCP Unauthenticated PowerShell Control via HTTP Transports
Windows-MCP versions prior to 0.7.5 are vulnerable to unauthenticated PowerShell control via HTTP transports due to wildcard CORS and missing authentication, allowing a remote attacker to execute arbitrary PowerShell commands as the user running Windows-MCP.
Windows-MCP versions prior to 0.7.5 are vulnerable to a critical security flaw in the SSE and Streamable HTTP transport modes. This vulnerability exposes the MCP control plane without authentication and enables wildcard CORS handling, effectively allowing unauthenticated remote attackers to execute arbitrary PowerShell commands. The PowerShell tool, registered within Windows-MCP, executes caller-controlled commands as the Windows user running the application. This vulnerability arises from the composition of two design flaws: the lack of authentication in the FastMCP instance and the blanket wildcard CORS policy, which permits cross-origin browsers and non-browser HTTP clients to access the MCP control plane. This combination allows attackers to bypass typical security measures, leading to arbitrary code execution on the affected system.
Attack Chain
- Attacker sends an HTTP OPTIONS request to the
/mcpendpoint with a craftedOriginheader. The server responds with wildcard CORS headers, includingaccess-control-allow-origin: *. - Attacker sends an HTTP POST request to the
/mcpendpoint to initialize an MCP session using theinitializemethod with a specified protocol version and client information. - The server creates an MCP session and returns a session ID to the attacker in the
mcp-session-idheader. - Attacker sends an HTTP POST request to the
/mcpendpoint, including the previously obtainedMcp-Session-Idin the header. - The attacker calls the
tools/callmethod to invoke thePowerShelltool. - The attacker includes arguments in the
tools/callrequest to execute a specified PowerShell command, such ascalc.exe. - The Windows-MCP application executes the attacker-supplied PowerShell command using
PowerShell -EncodedCommand. - The attacker achieves arbitrary code execution on the target system as the user running Windows-MCP.
Impact
Successful exploitation allows remote attackers to execute arbitrary PowerShell commands as the user running Windows-MCP. While Chrome/Edge may block or prompt for public-site-to-localhost requests due to Local Network Access / Private Network Access behavior, the exposure still applies to same-origin/private-origin contexts, browsers or apps without this enforcement, user-approved local-network prompts, browser extensions, and non-browser HTTP clients. This can lead to complete system compromise, data exfiltration, and further malicious activities.
Recommendation
- Upgrade to Windows-MCP version 0.7.5 or later to patch the vulnerability.
- Implement authentication for HTTP transports to prevent unauthenticated access to the MCP control plane.
- Remove wildcard CORS from MCP control endpoints and restrict allowed origins to explicit trusted clients.
- Enable and propagate transport security settings such as host validation.
- Monitor web server logs for HTTP OPTIONS requests with suspicious
Originheaders and subsequent requests to the/mcpendpoint using thewebserverlog source and deploy the Sigma rules in this brief to detect and alert on potential exploitation attempts.
Detection coverage 2
Detect Windows-MCP PowerShell Execution via HTTP
highDetects suspicious PowerShell execution via the Windows-MCP HTTP endpoint. This detects calls to the 'tools/call' method with the 'PowerShell' tool.
Detect Windows-MCP Wildcard CORS Configuration
mediumDetects HTTP OPTIONS requests to the Windows-MCP endpoint that return a wildcard Access-Control-Allow-Origin header, indicating a vulnerable CORS configuration.
Detection queries are available on the platform. Get full rules →