T09 · Insecure Skill Coding Practices
- Location
canvas_claw/client.py:15- Finding
API credentials and user content can be transmitted over plaintext HTTP
- Content
View full analysis
dict[str, str]: headers = { "token": self.config.token, "site-id": str(self.config.site_id), } if extra: headers.update(extra) return headers ``` ```python url = f"{self.config.base_url}{path}" if query: url = f"{url}?{parse.urlencode(query)}" req = request.Request( url, data=data, headers=self._build_headers(headers), method=method, ) ``` ```python def login(self, username: str, password: str) -> dict[str, Any]: payload = json.dumps( { "username": username, "password": password, } ).encode("utf-8") return self.request_json( "POST", "/api/login", data=payload, headers={"Content-Type": "application/json"}, ) ``` The base URL is loaded without validating or enforcing its scheme: ```python base_url = os.environ.get("AI_VIDEO_AGENT_BASE_URL", "").strip() ``` The installation instructions explicitly demonstrate a plaintext endpoint: ```bash export AI_VIDEO_AGENT_BASE_URL="http://localhost:8000" ``` ### Technical Analysis `CanvasClawClient` unconditionally attaches the API token and site identifier to requests. The login endpoint also sends the user's username and password in the HTTP request body. No check requires `AI_VIDEO_AGENT_BASE_URL` to use HTTPS. HTTP is reasonable for a strictly loopback-only development service, but the implementation does not limit HTTP to loopback addresses. A user can configure any remote HTTP host. When this occurs, credentials, API tokens, prompts, task information, and uploaded reference images or vid ...[truncated 1785 chars]- Remediation
View remediation
` header if supported by the service, while ensuring errors and logs never include the header value. 8. Add tests confirming that remote HTTP URLs are rejected, HTTPS URLs are accepted, and loopback HTTP is accepted only under the intended policy. ]]>
