T09 · Insecure Skill Coding Practices
- Location
scripts/scaffold-poc.js:37- Finding
Arbitrary JavaScript Injection in Generated POC Server
- Content
View full analysis
{ console.log(`{{POC_NAME}} started:http://127.0.0.1:${port}`); }); ``` ### Technical Analysis The `--name` argument is accepted without character validation or context-sensitive escaping. The generator performs a raw textual replacement of `{{POC_NAME}}` in every supported template file, including `server.js`. Because the placeholder occurs inside a JavaScript template literal, a value containing a backtick can terminate the string and introduce arbitrary JavaScript statements. The generated server is explicitly presented to the user as runnable output: ```js console.log(`Start server: node ${path.join(output, 'server.js')}`); ``` The vulnerable operation is source-code generation rather ...[truncated 1526 chars]- Remediation
View remediation
