未约束的固定点可能变成命令或 Git 选项注入
原文依据:3 处Skill 接受用户提供的任意固定点,并将其直接放入 git diff、git log 和 git rev-parse 命令模板;没有要求按参数安全传递、使用 -- 分隔选项或验证其为单个 Git 引用。
如果代理通过 shell 拼接执行含有元字符的值,可能以代理权限运行额外命令。即使不经过 shell,以连字符开头的值也可能被 Git 当成选项,改变输出或产生非预期文件操作。现有证据不能证明这种情况已经发生。
该风险有源码支持,但是否实际发生取决于代理怎样构造命令。Skill 将用户给出的固定点直接嵌入三个 Git 命令模板,未要求将其作为单个参数安全传递或拒绝 shell 元字符/选项。如果执行器把文本拼进 shell,恶意或误复制的值可能追加命令;若 Git 将其解析为选项,也可能改变预期操作。解析引用和检查非空 diff 不能消除这类风险。用户可要求作者限定为已解析的提交 SHA,并使用参数数组及 `--` 等边界措施。
Whatever the user said is the fixed point (a commit SHA, branch name, tag, `main`, `HEAD~5`, etc.). If they didn't specify one, ask for it.查看另外 2 个位置
Capture the diff command once: `git diff <fixed-point>...HEAD` (three-dot, so the comparison is against the merge-base). Also note the list of commits via `git log <fixed-point>..HEAD --oneline`.Before going further, confirm the fixed point resolves (`git rev-parse <fixed-point>`) and the diff is non-empty. A bad ref or empty diff should fail here, not inside two parallel sub-agents.