T09 · Insecure Skill Coding Practices
- Location
pipeline-mcp.yaml:11- Finding
Unauthenticated Externally Bound LLM Endpoint
- Content
View full analysis
Vulnerability Details
File Location:
pipeline-mcp.yaml, lines 11-19
Vulnerability Type: Unauthenticated network service and unrestricted paid API access
Risk Level: HighVulnerable Code
yaml config: http: enabled: true address: "0.0.0.0:${PORT:-8080}" input: http_server: path: /extract allowed_verbs: [POST] timeout: 60sRequests accepted by this endpoint are subsequently sent to OpenAI:
yaml - openai_chat_completion: api_key: "${OPENAI_API_KEY}" model: gpt-4o-miniTechnical Analysis
The HTTP service listens on
0.0.0.0, making it available through every network interface permitted by the host and surrounding network controls. The pipeline does not define authentication or authorization for the/extractendpoint.Every accepted request reaches the
openai_chat_completionprocessor and uses the operator-providedOPENAI_API_KEY. Consequently, any client capable of reaching the service can trigger a paid third-party API operation under the operator's account. The HTTP input also lacks an explicit request-body size limit, rate limit, concurrency limit, and validated upper bound for the client-controlledmax_keywordsvalue.Attack Path
- An attacker discovers or otherwise reaches the host's exposed port, which defaults to TCP port 8080.
- The attacker submits unauthenticated
POSTrequests to/extractcontaining arbitrary text. - The pipeline incorporates the attacker-controlled text and
max_keywordsvalue into an OpenAI request. - The
openai_chat_completionprocessor authenticates to OpenAI using the operator'sOPENAI_API_KEY. - The attacker repeats requests, or submits large request bodies, to consume API quota and local processing capacity.
- Costs and resource consumption accrue to the service operator without the attacker needing access to the API key itself.
Im
...[truncated 510 chars]
- Remediation
View remediation
Remediation Suggestions
- Bind the service to loopback by default, such as
127.0.0.1:${PORT:-8080}, unless remote access is explicitly required. - Require authentication and authorization before allowing requests to reach the pipeline. Use short-lived credentials or securely managed API tokens.
- If public exposure is necessary, place the service behind a TLS-enabled reverse proxy or API gateway with authentication, network access controls, and request auditing.
- Add per-client and global rate limits, concurrency limits, request timeouts, and usage quotas.
- Configure a strict HTTP request-body size limit appropriate for the intended workload.
- Validate
textas a bounded string and constrainmax_keywordsto a safe integer range, such as 1 through a documented maximum. - Apply OpenAI account-level spending limits, usage alerts, and restricted project credentials to limit financial impact.
- Avoid exposing detailed credentials or sensitive request content in logs, and monitor for abnormal request volume and API spending.
- Bind the service to loopback by default, such as
