Summary
The mcp-router CLI exposed its MCP aggregator on every network interface by default while requiring authentication only when an operator explicitly enabled it. As a result, any party able to reach the listening port could access the aggregator and the MCP servers it fronted without authentication.
Affected context
The vulnerability occurs when the mcp-router serve command is started with its default settings or with a non-loopback host without a required authentication token. In these conditions, the aggregator may listen beyond the local machine, allowing reachable clients to interact with fronted MCP servers without first proving their identity.
Exploit preconditions
- Attack surface: Network-accessible mcp-router aggregator listening endpoint
- Required access: Network connectivity to the configured listening port; no valid credentials are required
- Trigger point: Starting the
servecommand with default or externally reachable host settings - Why exploitation is possible: The service binds broadly and permits unauthenticated operation unless an operator explicitly supplies a token
Why this happens
The underlying bug is an insecure authentication and network-exposure default. The service listened on an all-interfaces address while treating authentication as optional, rather than requiring protection whenever the endpoint could be reached by other hosts. This maps to CWE-306: Missing Authentication for Critical Function, because access to the aggregator and its downstream operations was not consistently gated by an authentication mechanism.
Potential impact
- Unauthenticated users may interact with exposed MCP servers
- Attackers could invoke permitted tools or operations through the aggregator
- Sensitive data may be disclosed or modified
- Downstream systems reachable by MCP integrations could be affected
- The exposed service could become an entry point for broader network compromise
General mitigation guidance
Mitigation generally focuses on reducing network exposure and making authentication mandatory for every non-local service endpoint.
Common defensive patterns include:
- Bind services to the loopback address by default
- Require strong authentication whenever a service listens on a non-loopback address
- Treat authentication as mandatory rather than opt-in for externally reachable interfaces
- Place the aggregator behind an authenticated gateway or private network boundary
- Apply least-privilege permissions to MCP servers and downstream integrations
- Restrict inbound traffic with host, container, or network-level policy controls
- Avoid exposing administrative or tool-invocation endpoints directly to untrusted networks
How teams detect issues like this
Organizations can identify this class of issue through:
- Static analysis and configuration checks for listeners bound to wildcard or all-interface addresses
- Code review searches for optional authentication flags on network-facing commands
- Tests that verify unauthenticated requests are rejected on every non-loopback binding
- Runtime inventory of listening ports and exposed MCP aggregator endpoints
- Policy enforcement requiring authentication and network restrictions for service endpoints
- Automated security review tools that flag broad bindings combined with missing access control

