T09 · Insecure Skill Coding Practices
- Location
scripts/video_gen.js:19- Finding
Unrestricted API Endpoint Overrides Can Disclose the WeryAI API Key
- Content
View full analysis
controller.abort(), 30000); try { const res = await fetch(fullUrl, { method, headers, body: body != null ? JSON.stringify(body) : undefined, signal: controller.signal, }); ``` ```js async function apiRequest(method, path, body, apiKey) { return httpJson(method, BASE_URL + path, body, apiKey); } async function fetchModelsRegistry(apiKey) { return httpJson('GET', MODELS_BASE_URL + MODELS_API_PATH, null, apiKey); } ``` The related vendored client follows the same pattern: ```js const url = `${baseUrl}${path}`; const headers = { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json', }; ``` ```js const res = await fetch(url, { method, headers, body: body ? JSON.stringify(body) : undefined, signal: controller.signal, }); ``` ### Technical Analysis The Skill legitimately requires network access and must send `WERYAI_API_KEY` to WeryAI to authenticate video-generation and model-registry requests. Sending the credential to the documented default WeryAI hosts is therefore necessary for the declared functionality. However, `WERYAI_BASE_URL` and `WERYAI_MOD ...[truncated 2788 chars]- Remediation
View remediation
