T09 · Insecure Skill Coding Practices
- Location
scripts/video_gen.js:161- Finding
Declared Model and Generation-Mode Restrictions Are Not Enforced by the CLI
- Content
View full analysis
0) return 'multi_image'; if (typeof params.image === 'string' && params.image) return 'image'; return 'text'; } function coerceBool(v, defaultVal = false) { if (v == null) return defaultVal; if (typeof v === 'boolean') return v; return String(v).toLowerCase() === 'true'; } function hasNonEmptyModel(params) { const m = params.model; return m != null && String(m).trim() !== ''; } function buildRequestBody(params) { const model = String(params.model).trim(); const body = { prompt: params.prompt, model, duration: Number(params.duration) || 5, }; if (params.aspect_ratio) body.aspect_ratio = params.aspect_ratio; if (params.resolution) body.resolution = params.resolution; if (params.generate_audio != null) body.generate_audio = coerceBool(params.generate_audio, false); if (params.negative_prompt) body.negative_prompt = params.negative_prompt; if (params.image) body.image = params.image; if (params.images) body.images = params.images.slice(0, 3); return body; } async function submitTask(params, apiKey) { if (!hasNonEmptyModel(params)) { return { ok: false, phase: 'failed', errorCode: 'MISSING_PARAM', errorMessage: "'model' is requ ...[truncated 3812 chars]- Remediation
View remediation
