T09 · Insecure Skill Coding Practices
Warning
- Location
- pipeline-mcp.yaml:24
- Finding
- Unauthenticated MCP Service Exposed on All Network Interfaces<![CDATA[ ## Vulnerability Details **File Location**: `pipeline-mcp.yaml:24-32` **Vulnerability Type**: Unauthenticated externally reachable service **Risk Level**: Medium ### Vulnerable Code ```yaml config: http: enabled: true address: "0.0.0.0:${PORT:-8080}" input: http_server: path: /triage allowed_verbs: [POST] timeout: 120s # Email processing can take time ``` ### Technical Analysis The MCP HTTP server binds to `0.0.0.0`, making it accessible through every network interface available to the host. The configuration does not define client authentication or authorization for the `/triage` endpoint. Every accepted request proceeds to the configured OpenAI processor, which uses the operator-provided `OPENAI_API_KEY`. Although the API key is not returned to the caller, an unauthenticated caller can cause the service to make paid API requests with that key. Binding to every interface exceeds the minimum privilege required for the documented local OpenClaw/MCP integration. A loopback-only listener would normally be sufficient. Restricting the endpoint to `POST` does not provide access control. ### Attack Path 1. An operator starts the MCP pipeline with an OpenAI API key. 2. The service listens on port 8080 across all host network interfaces. 3. An attacker who can reach that port sends repeated `POST /triage` requests. 4. The pipeline accepts the requests without verifying the caller's identity or permissions. 5. Each request reaches the OpenAI processor and consumes the operator's API quota and local processing resources. 6. The attacker can repeat the operation to cause cost growth, quota exhaustion, or service degradation. ### Impact Assessment An attacker does not obtain the OpenAI API key or operating-system privileges from the shown code. However, a network-reachable attacker can exercise the pipeline using the owner's configured credentials and resources. The affected scope includes: - Unauthorized use of pai ...[truncated 426 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Bind to the loopback interface by default: ```yaml address: "127.0.0.1:${PORT:-8080}" ``` 2. Require authentication before pipeline execution, such as a high-entropy bearer token, mutually authenticated TLS, or authentication enforced by a trusted local gateway. 3. Reject requests without valid authorization before invoking any paid backend. 4. Apply per-client request limits, global concurrency limits, and explicit OpenAI usage budgets. 5. Set a small maximum HTTP request-body size and reject malformed or oversized payloads. 6. If remote access is required, use TLS and an explicit allowlist rather than exposing the service directly. 7. Document that binding to a non-loopback address changes the trust model and must be accompanied by firewall and authentication controls. ]]>
