T09 · Insecure Skill Coding Practices
- Location
scripts/video_gen.js:206- Finding
Unrestricted Local File Read and Upload Through Image Parameters
- Content
View full analysis
controller.abort(), 60_000); let res; try { res = await fetch(MODELS_BASE_URL + UPLOAD_API_PATH, { method: 'POST', headers: { Authorization: `Bearer ${apiKey}`, }, body: form, signal: controller.signal, }); } catch (err) { clearTimeout(timer); if (err.name === 'AbortError') { throw new Error(`Upload timeout: ${filePath}`); } throw err; } clearTimeout(timer); let data; try { data = await res.json(); } catch { throw new Error(`Upload failed with non-JSON response (HTTP ${res.status}).`); } const wrapped = { httpStatus: res.status, ...data }; if (!isApiSuccess(wrapped)) { const apiErr = formatApiError(wrapped); throw new Error(apiErr.errorMessage || `Upload failed (HTTP ${res.status}).`); ...[truncated 3834 chars]- Remediation
View remediation
