T09 · Insecure Skill Coding Practices
- Location
src/runtime/chunked-render.mjs:120- Finding
Untrusted Composition Files Execute with Full Node.js Process Privileges
- Content
View full analysis
= 0) { const setup = lines.slice(0, lastExprStart).join('\n'); const expr = lines.slice(lastExprStart).join('\n'); const fn = new Function(setup + '\nreturn ' + expr); pattern = fn(); } else { try { pattern = new Function(patternCode)(); } catch { pattern = new Function('return ' + patternCode)(); } } } ``` ### Technical Analysis The renderer reads an arbitrary JavaScript composition and evaluates it through the `Function` constructor in the main renderer process. `new Function()` is not a sandbox. Evaluated code can access globally available Node.js objects and APIs and executes with the same operating-system identity and privileges as the renderer. The renderer does not apply the partial environment and `child_process` restrictions found in `offline-render-v2.mjs`. The visualization-method stripping routine is a compatibility transformation, not a security control, and does not prevent compositions from reading files, modifying files, accessing environment variables, or making network requests. The documentation warns users to trust or review compositions, but this warning does not create an enforceable privilege boundary. ...[truncated 1316 chars]- Remediation
View remediation
