You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 AI 代码审查声明:本 issue 由 AI 模型 Claude Fable 5(Anthropic,运行于 Claude Code)在一次完整代码审查中发现并撰写,经 @josephmqiu 授权提交。审查基于当前 main 分支 HEAD(commit c5ece53)的源码逐行阅读。本问题属于本地误操作/注入风险,非远程可利用漏洞,仓库未提供私密报告渠道(无 SECURITY.md),故直接公开提交。
English TL;DR: /delete-ex instructs the agent to run rm -rf exes/{slug} with a fully unsanitized user-supplied slug — /delete-ex ../.. escapes the exes directory (with global install, that's inside ~/.claude). Suggested fix: move deletion into the Python tool with slug whitelist validation, resolved-path containment check, a meta.json existence check, and explicit user confirmation; never let the model template raw rm -rf. Local-misuse risk only, not remotely exploitable; filed publicly as the repo has no SECURITY.md.
Important
🤖 AI 代码审查声明:本 issue 由 AI 模型 Claude Fable 5(Anthropic,运行于 Claude Code)在一次完整代码审查中发现并撰写,经 @josephmqiu 授权提交。审查基于当前 main 分支 HEAD(commit
c5ece53)的源码逐行阅读。本问题属于本地误操作/注入风险,非远程可利用漏洞,仓库未提供私密报告渠道(无 SECURITY.md),故直接公开提交。问题描述
/delete-ex {slug}的实现是让 agent 直接执行模板拼接的 shell 命令(中文版 SKILL.md 第 350-354 行,英文版第 619-622 行):rm -rf exes/{slug}其中
{slug}来自用户输入,没有任何校验、转义或路径约束。风险场景
/delete-ex ../..会拼接出rm -rf exes/../..,即删除项目上层目录。如果按 README 的全局安装方式(~/.claude/skills/create-ex)运行,上层目录就是用户的~/.claude。rm -rf没有确认、没有回收站。rm -rf。模型对模板的理解偏差(错误替换、多余展开)都会直接变成不可逆的删除。让模型裸拼rm -rf本身就是应当避免的模式。补充:其余 Python 工具的
--slug/--base-dir参数同样未校验(如version_manager.py:120-121直接Path(args.base_dir) / args.slug),只是它们不具破坏性,风险较低。修复建议
rm -rf,改为:python3 ${CLAUDE_SKILL_DIR}/tools/skill_writer.py --action delete --slug {slug} --base-dir ./exesmeta.json中的 name,由用户明确确认后再执行。如需要,我可以提交对应的 PR(新增
--action delete+ 更新 SKILL.md 中英文两处)。English TL;DR:
/delete-exinstructs the agent to runrm -rf exes/{slug}with a fully unsanitized user-supplied slug —/delete-ex ../..escapes the exes directory (with global install, that's inside~/.claude). Suggested fix: move deletion into the Python tool with slug whitelist validation, resolved-path containment check, a meta.json existence check, and explicit user confirmation; never let the model template rawrm -rf. Local-misuse risk only, not remotely exploitable; filed publicly as the repo has no SECURITY.md.