Summary
The Nhost CLI MCP server can be started in a mode where it listens on a network port without enforcing inbound authentication or strict CORS controls.
In this configuration, a malicious website visited on the same machine can send cross-origin requests to the local MCP server and invoke privileged tools using the developer's own credentials.
Affected context
This vulnerability affects environments where the Nhost CLI MCP server is:
- Explicitly configured to listen on a network port (non-default behavior), and
- Exposed to requests from the local browser context without proper origin restrictions.
It primarily impacts developers running Nhost CLI locally with customized MCP settings that relax default protections, allowing local web pages to reach the MCP server as if they were trusted clients.
Exploit preconditions
- Attack surface: Local MCP HTTP endpoint bound to a network interface (e.g., localhost or other interfaces).
- Required access: Ability to lure the developer into visiting a malicious or compromised website in a regular browser session on the same machine.
- Trigger point: The browser automatically issues cross-origin HTTP requests from the malicious site to the MCP server.
- Why exploitation is possible:
- The MCP server does not require authentication for inbound requests (CWE-306).
- CORS handling is not strict enough to block untrusted origins (CWE-942).
- The server executes privileged operations using the developer's local Nhost configuration and credentials without verifying the requesting origin or user.
Why this happens
The core issue stems from exposing a powerful local service over HTTP without enforcing strong caller identity checks or robust cross-origin controls.
When configured to listen on a network port, the MCP server trusts any HTTP client that can reach it and does not require authentication tokens, session checks, or origin validation.
This aligns with:
- CWE-306 (Missing Authentication for Critical Function): Critical administrative or automation actions are available without verifying who is invoking them.
- CWE-942 (Overly Permissive Cross-domain Policy): The lack of strict CORS or origin restrictions allows websites from arbitrary domains to act as clients, leveraging the browser as a bridge to the local MCP server.
Potential impact
- Malicious websites may trigger privileged MCP tools as the developer.
- Attackers could read, modify, or delete project-related data accessible through MCP tools.
- Local development environments and configurations can be altered or disrupted.
- Credentials or secrets managed via MCP tools may be exposed indirectly, depending on tool behavior and logs.
- Unintended remote control of local automation workflows can occur while the developer is browsing.
General mitigation guidance
Effective mitigation focuses on tightening access boundaries and minimizing implicit trust in local services:
- Prefer the default MCP configuration, which does not expose the server on a network port unless explicitly needed.
- Restrict the MCP server to the most limited interface feasible (e.g., loopback only) and avoid binding to broad network interfaces.
- Require explicit authentication (API keys, tokens, or local session binding) for any endpoint that performs privileged actions.
- Enforce strict CORS policies, allowing only explicitly trusted origins, and avoid wildcard or permissive configurations.
- Reduce the privilege of the MCP tooling, ensuring it operates with the least access necessary to perform its tasks.
- Educate developers to be cautious when exposing local development services and to avoid browsing untrusted sites while such services are running.
How teams detect issues like this
Detection approaches typically focus on configuration review and behavioral monitoring:
- Static or configuration analysis to flag MCP server setups that:
- Bind to external or non-localhost interfaces, or
- Enable HTTP endpoints without authentication or with permissive CORS.
- Code review checklists highlighting:
- Any HTTP listener that executes privileged actions without explicit auth and origin checks.
- CORS middleware configured with overly broad origins, methods, or credentials flags.
- Local security agents or developer tooling that:
- Monitor for unexpected inbound browser requests to local high-privilege services.
- Alert when local services expose administrative or automation endpoints without auth.
- Integration of automated security scanners or CI checks that validate default-hardening of CLI tools and development servers.

