T09 · Insecure Skill Coding Practices
- Location
scripts/send_comment_reply.js:118- Finding
Generated Reply Text Can Be Injected into Executable Browser JavaScript
- Content
View full analysis
- Remediation
View remediation
{ return sendReply(replyText); }, generatedReply); ``` 3. Prefer Playwright locator APIs, which treat input as data: ```javascript await replyInput.fill(generatedReply); await sendButton.click(); ``` 4. Remove the `__REPLY_TEXT__` execution pattern and the documented `sendReply('reply content')` pattern. 5. If browser evaluation source must be serialized, use a trusted static function and pass values through the tool's argument mechanism rather than manual quoting. 6. Validate generated replies before submission, including maximum length, control-character rejection, and content-policy checks. 7. Add tests containing quotes, backslashes, line separators, template-literal markers, and JavaScript-like text to ensure all reply content remains inert data. ]]>
