把用户提示直接插入示例命令可能造成 shell 命令注入
原文依据:2 处示例把提示放进单引号包围的 JSON shell 参数。若代理按此模板直接插入含单引号、换行或 shell 语法的用户提示,shell 会在 CLI 收到 JSON 前解析逸出的文本。文档关于“无 shell 注入面”的保证只描述 CLI,不消除命令构造阶段的风险。
恶意或意外构造的提示可能以当前用户权限运行本地命令,读取或修改文件、调用已登录账户,或泄露凭据。
示例把 `<user prompt>` 放入 shell 的单引号 JSON 参数。若代理通过文本替换构造命令,提示中的单引号可提前结束引号,使其后的内容被 shell 解释。第192行的保证只说明 CLI 收到内容后的行为,并不能证明命令构造过程安全;材料也没有提供实际转义实现。风险取决于代理是否直接拼接示例。
```bashruncomfy run happyhorse/happyhorse-1-0/text-to-video \ --input '{"prompt": "<user prompt>"}' \ --output-dir <absolute/path>```查看另外 1 个位置
- **Token storage**: `runcomfy login` writes the API token to `~/.config/runcomfy/token.json` with mode 0600 (owner-only read/write). Set `RUNCOMFY_TOKEN` env var to bypass the file entirely in CI / containers.- **Input boundary**: the user prompt is passed as a JSON string to the CLI via `--input`. The CLI does NOT shell-expand the prompt; it transmits the JSON body directly to the Model API over HTTPS. No shell injection surface from prompt content.- **Third-party content**: image / mask / video URLs you pass are fetched by the RunComfy model server, not by the CLI on your machine. Treat external URLs as untrusted; image-based prompt injection is a known risk for any image-edit / video-edit model.