T09 · Insecure Skill Coding Practices
- Location
scripts/video_toolkits.js:19- Finding
Unrestricted API Endpoint Override Can Disclose Credentials and Local Files
- Content
View full analysis
controller.abort(), 60000); let res; try { res = await fetch(`${BASE_URL}${UPLOAD_API_PATH}`, { method: "POST", headers: { Authorization: `Bearer ${apiKey}` }, body: form, signal: controller.signal, }); } catch (error) { clearTimeout(timer); if (error?.name === "AbortError") throw new Error(`Upload timeout: ${source}`); throw error; } clearTimeout(timer); ``` ```js async function httpJson(method, url, body, apiKey) { const headers = { "Content-Type": "application/json", }; if (apiKey) headers.Authorization = `Bearer ${apiKey}`; const controller = new AbortController(); const timer = setTimeout(() => controller.abort(), 30000); try { const res = await fetch(url, { method, headers, body: body != null ? JSON.stringify(body) : undefined, signal: c ...[truncated 2980 chars]- Remediation
View remediation
