T09 · Insecure Skill Coding Practices
- Location
scripts/aivideo-client.mjs:73- Finding
Unrestricted Custom API Origin Can Exfiltrate the API Key and User Payloads
- Content
View full analysis
controller.abort(), config.timeoutMs); const headers = { key: config.apiKey, "Content-Type": "application/json", ...extraHeaders, }; try { logger.debug("sending request", { method, url, attempt, headers }); const response = await fetch(url, { method, headers, body: body ? JSON.stringify(body) : undefined, signal: controller.signal, }); ``` ### Technical Analysis `createAIVideoClient` merges caller-supplied options over the secure defaults. Consequently, a caller can replace the default `https://aivideomaker.ai` base URL with an arbitrary destination. The request function then constructs a URL from this unvalidated value and automatically attaches `config.apiKey` as the `key` header. It does not: - Restrict the hostname to `aivideomaker.ai`. - Require the HTTPS protocol. - Reject embedded URL credentials, unexpected ports, or local network destinations. - Bind the API credential to a specific approved origin. Generation requests also include the complete user-supplied payload. Such payloads may contain prompts or base64-encoded images. The ...[truncated 2106 chars]- Remediation
View remediation
