T09 · Insecure Skill Coding Practices
- Location
assets/mcp-app-template/server.ts:85- Finding
Unauthenticated MCP Endpoint Exposed on All Network Interfaces with Unrestricted CORS
- Content
View full analysis
{ const server = createServer(); const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined, }); res.on("close", () => { transport.close().catch(() => {}); server.close().catch(() => {}); }); try { await server.connect(transport); await transport.handleRequest(req, res, req.body); ``` ### Technical Analysis The MCP server binds to `0.0.0.0`, making it reachable through every available network interface. The default `cors()` middleware accepts requests from arbitrary browser origins. No authentication, authorization, or caller identity validation occurs before the request is passed to `transport.handleRequest()`. The same implementation is presented as the required server pattern in `references/mcp-app-spec.md`, meaning applications generated from this Skill are likely to preserve the vulnerable configuration. Although the included sample tool only produces generated sample data, this is a scaffolding project intended to be customized with tools that may access databases, private APIs, files, or other sensitive services. Those tools would inherit the unauthenticated endpoint unless the developer adds controls separately. ### Attack Path 1. A developer creates an application from this template and starts the server. 2. The service binds to all network interfaces on the configured port. 3. The developer exposes the service through a public tunnel, cloud deployment, container port mapping, or reachable local network. 4. An attacker discovers or obtains ...[truncated 1015 chars]- Remediation
View remediation
