T09 · Insecure Skill Coding Practices
- Location
scripts/plan-screenshots.py:94- Finding
Shell Command Injection Through an Unescaped Video Filename
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly coherent for video-to-notes workflows, but it includes unsafe script and Git examples that can execute unintended shell code or publish unrelated files.
Review before installing. Use it only in a sandboxed course workspace, inspect `_batch_screenshots.sh` carefully before running it, avoid untrusted course archives with unusual filenames, do not store cookies in notes or repositories, and replace the Git example with explicit `git status`, scoped `git add -- <generated paths>`, a staged diff review, then a separate commit and push confirmation.
scripts/plan-screenshots.py:94Shell Command Injection Through an Unescaped Video Filename
SKILL.md:251Overbroad Git Staging Can Commit Unrelated Sensitive Files
声明描述的是一个较完整的“视频/字幕/课程目录 -> 结构化图文笔记”工作流,重点在生成文章、笔记、写入 Obsidian 或批量导入课程内容。而实际代码仅执行截图规划:遍历课程目录、定位 mp4、调用 ffprobe 读取时长、计算截图时间戳、生成 JSON 计划和 ffmpeg 批处理命令。它没有处理字幕、没有生成结构化笔记或文章、没有写入 Obsidian,也没有实现课程导入流程。虽然截图可能是更大工作流的辅助步骤,但就该代码块本身而言,其主要行为与声明的核心用途存在明显偏差。
声明描述的是一个较完整的“视频/课程转结构化笔记或文章”工作流,包含较高层次的内容转换与导入能力,并强调仅在用户明确要求完整工作流时使用。而实际代码只是一个非常具体的预处理脚本:在本地课程目录中查找字幕文件,删除序号和时间戳,按 section 合并后输出纯文本文件。这属于工作流中的一个辅助步骤,但其实际主功能明显比声明窄得多,也没有实现声明中的核心产物(结构化图文笔记/文章)和关键操作(下载视频、写入 Obsidian、批量导入课程)。因此描述不能准确代表该代码块的实际行为,构成明显不匹配。
The example child-agent context explicitly says '用英文写课程笔记。' ('Write course notes in English'), which imposes a language choice. The policy allows locale/language constraints only when the user is offered a choice or when the constraint is clearly documented and justified; neither is present here.
The workflow explicitly instructs running a generated shell script and later committing results, but it does not require an explicit user confirmation or present safety checks around file-system changes. In an agent setting, generated scripts and automated commits can turn untrusted or incorrectly derived inputs into real system modifications, making unintended execution and persistence more likely.
The instruction "Write the course note in English" imposes a specific language requirement in natural language. The file does not present this as user-selectable or explain that the workflow is intentionally English-only for a documented regional or compliance reason.
The skill explicitly recommends cookie-based login for Bilibili but provides no warning that cookies are sensitive authentication material equivalent to a logged-in session. In an agent workflow, users may be prompted to export or share cookies without understanding the account-takeover and privacy risks if those cookies are stored, logged, or exfiltrated.
The template instruction explicitly says "Write the course note in English," which imposes a specific language choice. Under the policy, language constraints should not be forced unless the skill offers user choice or clearly documents a justified locale restriction.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"default=noprint_wrappers=1:nokey=1",
video_path,
]
result = subprocess.run(cmd, capture_output=True, text=True)
return float(result.stdout.strip())
def slugify(name):
The guidance suggests switching network routes or using a proxy to bypass region restrictions, but omits any warning about privacy, legal/policy, and traffic interception risks. In a skill that may be followed operationally by an agent or user, this can normalize sending video URLs and session-linked traffic through third-party infrastructure without informed consent.
No suspicious patterns detected.