T09 · Insecure Skill Coding Practices
Error
- Location
- bin/cli.js:91
- Finding
- Basic Authentication Credentials and Workflow Data Transmitted Over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `bin/cli.js:6-9`, `bin/cli.js:39-45`, `bin/cli.js:91-98`, and `bin/cli.js:130` **Vulnerability Type**: Plaintext transmission of sensitive data **Risk Level**: High ### Vulnerable Code ```js const host = getEnv("COMFYUI_HOST", "192.168.179.111"); const port = getEnv("COMFYUI_PORT", "28188"); const user = getEnv("COMFYUI_USER", ""); const pass = getEnv("COMFYUI_PASS", ""); ``` ```js function authHeaders() { const headers = { "content-type": "application/json" }; if (user && pass) { const tok = Buffer.from(user + ":" + pass).toString("base64"); headers["authorization"] = "Basic " + tok; } return headers; } ``` ```js const base = "http://" + host + ":" + port; const submitUrl = base + "/prompt"; const payload = { prompt: workflow, client_id }; const { res: sres, data: sdata } = await httpJson(submitUrl, { method: "POST", headers: authHeaders(), body: JSON.stringify(payload), }); ``` ```js const { res: hres, data: hdata, txt } = await httpJson(histUrl, { method: "GET", headers: authHeaders() }); ``` ### Technical Analysis The server base URL is unconditionally constructed with the `http://` scheme. When `COMFYUI_USER` and `COMFYUI_PASS` are configured, the application places those credentials in an HTTP Basic Authentication header. Basic Authentication only Base64-encodes the username and password; it does not encrypt them. Consequently, every submission and polling request exposes the encoded credentials to anyone capable of observing plaintext network traffic. The submitted workflow, prompt identifier, execution history, output metadata, and server responses are also sent without transport confidentiality or integrity protection. Because HTTPS cannot be selected through the current host and port configuration, users cannot securely enable Basic Authentication without modifying the source or placing the service behind another trusted transport mechanism. ### Attack Path 1. A u ...[truncated 1533 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the separate host and port configuration with a validated full base URL, such as `COMFYUI_BASE_URL`, and default to an `https://` endpoint. 2. Reject `http://` endpoints whenever authentication credentials are configured. If plaintext transport is required for isolated development environments, require an explicit opt-in flag and emit a prominent warning. 3. Configure the ComfyUI service or a trusted reverse proxy with TLS and validate certificates using the normal Node.js trust chain. Do not disable certificate verification. 4. Prefer scoped, revocable bearer tokens over reusable username and password credentials if the target service supports them. 5. Ensure credentials are loaded only from protected environment or secret-management facilities and are never included in output or diagnostic messages. 6. Minimize response data returned on failures, especially raw history responses that may contain sensitive workflow or infrastructure details. 7. Update `SKILL.md` to document the actual `/prompt`, `/history/{prompt_id}`, and `/view` interactions and the requirement for encrypted transport. ]]>
