Skip to content

fix(security): restrict MCP server CORS and MITM proxy bind address#14

Open
aaronjmars wants to merge 1 commit intoMouseww:mainfrom
aaronjmars:security/fix-cors-and-bind-address
Open

fix(security): restrict MCP server CORS and MITM proxy bind address#14
aaronjmars wants to merge 1 commit intoMouseww:mainfrom
aaronjmars:security/fix-cors-and-bind-address

Conversation

@aaronjmars
Copy link
Copy Markdown

Security Vulnerability Report

Vulnerability 1: MCP Server Wildcard CORS (Critical)

Type: CORS Misconfiguration — Cross-Origin Data Theft
Severity: Critical
Location: src/main/mcp/mcp-server.ts:70

Description

The MCP HTTP server sets Access-Control-Allow-Origin: * with no authentication. Any website the user visits in any browser can send cross-origin requests to the local MCP server (default port 23816) and:

  • Read all captured HTTP requests — including auth tokens, cookies, session data, passwords
  • Navigate the embedded browser to arbitrary URLs (phishing, credential harvesting)
  • Start/stop capture sessions and trigger AI analysis
  • Clear browser storage (cookies, localStorage)

A malicious website only needs to know the port (which is hardcoded in the source) to fully exploit this.

Fix

Validate the Origin header and reject requests from non-localhost origins. Requests without an Origin header (from CLI tools, non-browser MCP clients) are still allowed. When a valid localhost origin is present, it's reflected back instead of using a wildcard.


Vulnerability 2: MITM Proxy Bound to All Interfaces (High)

Type: Network Exposure
Severity: High
Location: src/main/proxy/mitm-proxy-server.ts:58

Description

The MITM proxy listens on 0.0.0.0 (all network interfaces), exposing it to every device on the local network. Any device on the same Wi-Fi or LAN segment can:

  • Route their HTTP/HTTPS traffic through the proxy
  • Have their HTTPS connections decrypted via the dynamically-issued certificates
  • Have all their traffic (including credentials, API keys, private data) captured in the app's database

On shared or public networks, this is especially dangerous.

Fix

Bind to 127.0.0.1 instead of 0.0.0.0 so the proxy only accepts connections from the local machine.


Impact

Without these fixes:

  • Any website can steal all data captured by the analyzer (CORS vuln)
  • Any device on the LAN can have its HTTPS traffic intercepted (bind address vuln)

Both vulnerabilities are silently exploitable with no user interaction beyond normal app usage.


Found by Aeon — automated security scanner

Vulnerability 1: MCP Server wildcard CORS (Critical)
The MCP HTTP server set Access-Control-Allow-Origin: * with no
authentication, allowing any website to interact with the local MCP
server — reading captured HTTP traffic (credentials, tokens, cookies),
controlling the embedded browser, and triggering AI analysis.

Fix: Validate the Origin header and only allow requests from localhost
or 127.0.0.1 origins. Non-browser clients (no Origin header) are still
permitted.

Vulnerability 2: MITM proxy bound to 0.0.0.0 (High)
The MITM proxy listened on all network interfaces, exposing it to the
entire LAN. Any device on the same network could route traffic through
the proxy, having their HTTPS connections decrypted and captured.

Fix: Bind to 127.0.0.1 instead of 0.0.0.0.
@Mouseww
Copy link
Copy Markdown
Owner

Mouseww commented Apr 17, 2026

限制127.0.0.1之后就没办法做服务器部署了,后面可能发到外网,然后内置一些操作好的session开出来用

@Mouseww
Copy link
Copy Markdown
Owner

Mouseww commented Apr 17, 2026

本修复有效,但需要调整下,不要仅支持本地连接

@Mouseww
Copy link
Copy Markdown
Owner

Mouseww commented Apr 17, 2026

我会加入鉴权机制

@Mouseww
Copy link
Copy Markdown
Owner

Mouseww commented Apr 17, 2026

MITM Proxy 必须0.0.0.0 不然局域网内手机无法抓包

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants