T09 · Insecure Skill Coding Practices
- Location
packages/renderer/src/render.ts:9- Finding
Asset Path Traversal and Unsafe SVG Injection
- Content
View full analysis
{ const issues = validateProject(project); if (issues.length) throw new Error(issues.map((issue) => `${issue.path}: ${issue.message}`).join("\n")); const prepared = structuredClone(project) as PreparedProject; for (const scene of prepared.scenes) for (const object of scene.objects) if (object.kind === "svg" && object.asset) object.assetContent = await readFile(join(assetDirectory, object.asset), "utf8"); const entryPoint = join(dirname(fileURLToPath(import.meta.url)), "index.js"); const serveUrl = await bundle({ entryPoint }); const composition = await selectComposition({ serveUrl, id: "HandDrawAnimation", inputProps: { project: prepared } }); await renderMedia({ composition, serveUrl, codec: "h264", outputLocation, inputProps: { project: prepared } }); } ``` ```tsx // packages/renderer/src/Root.tsx:49 return <>{!narrative && }; ``` ### Technical Analysis The project validator only verifies that an SVG object has a non-empty `asset` property. It does not ensure that the value is a relative, normalized SVG path located beneath the configured asset directory. The renderer passes the untrusted asset value directly to: ```ts join(assetDirectory ...[truncated 2331 chars]- Remediation
View remediation
