T09 · Insecure Skill Coding Practices
- Location
references/schedule-prompt-template.md:13- Finding
Unvalidated context values are embedded in persistent scheduled shell commands
- Content
View full analysis
" && python scripts/_executor.py ``` 任务说明: - 数据源: - 抓取/处理数量: - <其他关键参数>: - 凭证: 从环境变量 读取(已在 User 级环境变量中配置) 归档要求(三端同步): - 飞书云盘: /.md - Obsidian inbox: /-.md - IMA知识库: / - 归档格式: Markdown + 元数据头(任务名/运行时间/数据源/状态) IM提醒:运行完成后通过 lark-im skill 发送飞书 Interactive Card: - 卡片标题: <任务名> 运行<状态> - 卡片内容: 摘要(3-5条要点) - 卡片按钮: 跳转飞书云盘详情文档 如果主执行器失败,回退到分步: 1. python scripts/.py 2. python scripts/.py 3. python scripts/.py 4. python scripts/.py ``` The source of these values is defined in `SKILL.md`: ```markdown ### Step 1: 上下文扫描 读取当前会话上下文,提取:任务名 / 核心逻辑 / 数据源 / 依赖脚本 / 依赖环境变量 / 输出格式 ``` ### Technical Analysis The Skill extracts task names, project paths, dependent scripts, parameters, and related values from the current conversation and inserts them into shell commands stored in a persistent Schedule message. No validation requirements are defined for: - Canonical project paths - Script names or script locations - Shell arguments - Embedded quotation marks - Newline characters - Shell operators or metacharacters - Whether fallback scripts remain inside the approved project directory The primary command only quotes the project root, while the script path and fallback arguments are interpolated directly. Even the quoted project root remains unsafe if an inserted value contains a quotation mark followed by shell syntax. Because the resulting message is consumed by an Agent during later scheduled runs, unsafe content is not limited to the current interaction. A malicious or accidentally ma ...[truncated 1518 chars]- Remediation
View remediation
