跳转到正文
报告库
用途分类 / 文档处理

Code Review Skill 安全审计

作者说它能做什么(原文)

Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/spec asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to

第三方安全检查结论

先别安装或运行

已检查文件
2
发现的风险
2
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。发现 1 项风险
高风险

未约束的固定点可能变成命令或 Git 选项注入

原文依据:3 处
发现了什么

Skill 接受用户提供的任意固定点,并将其直接放入 git diff、git log 和 git rev-parse 命令模板;没有要求按参数安全传递、使用 -- 分隔选项或验证其为单个 Git 引用。

为什么需要注意

如果代理通过 shell 拼接执行含有元字符的值,可能以代理权限运行额外命令。即使不经过 shell,以连字符开头的值也可能被 Git 当成选项,改变输出或产生非预期文件操作。现有证据不能证明这种情况已经发生。

该风险有源码支持,但是否实际发生取决于代理怎样构造命令。Skill 将用户给出的固定点直接嵌入三个 Git 命令模板,未要求将其作为单个参数安全传递或拒绝 shell 元字符/选项。如果执行器把文本拼进 shell,恶意或误复制的值可能追加命令;若 Git 将其解析为选项,也可能改变预期操作。解析引用和检查非空 diff 不能消除这类风险。用户可要求作者限定为已解析的提交 SHA,并使用参数数组及 `--` 等边界措施。

SKILL.md:19来自说明文档打开原文件
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 个位置
SKILL.md:21来自说明文档打开原文件
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`.
SKILL.md:23来自说明文档打开原文件
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.
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。未发现风险
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。未发现风险
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。发现 1 项风险
中风险

仓库和工单内容被放入子代理上下文,但没有提示注入防护

原文依据:4 处
发现了什么

Skill 从提交消息定位并获取工单,读取仓库中的规范和需求文件,还要求把规范基线及需求路径或获取内容交给子代理。它没有要求把这些内容仅作为不可信数据,也没有要求忽略其中针对代理的指令。

为什么需要注意

恶意提交消息、工单、规范或需求文件可伪装成指令,诱使子代理偏离只读审查、隐藏问题、读取额外数据或尝试其他工具操作。实际影响取决于子代理权限;现有材料没有表明攻击已经发生。

Skill 会获取工单内容、读取仓库中的规范/标准,并把这些内容或路径放入子代理上下文,但没有明确要求子代理把它们仅视为不可信证据并忽略其中的操作指令。若仓库文件或工单含有提示注入文本,子代理可能偏离审查、泄露其可访问的信息或执行非预期工具操作。既定审查 brief 提供了一些范围约束,但并非注入防护。用户可要求作者明确标记外部内容为不可信、只提取所需事实,并限制子代理工具和写入权限。

SKILL.md:29来自说明文档打开原文件
1. Issue references in the commit messages (`#123`, `Closes #45`, GitLab `!67`, etc.), fetched via the workflow in `docs/agents/issue-tracker.md`.2. A path the user passed as an argument.
查看另外 3 个位置
SKILL.md:36来自说明文档打开原文件
Anything in the repo that documents how code should be written, such as `CODING_STANDARDS.md` or `CONTRIBUTING.md`.
SKILL.md:63来自说明文档打开原文件
- The full diff command and commit list.- The list of standards-source files you found in step 3, **plus the smell baseline from step 3** pasted in full (the sub-agent has no other access to it).- The brief: "Report, per file/hunk where relevant, (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls: documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces. Under 400 words."
SKILL.md:69来自说明文档打开原文件
- The diff command and commit list.- The path or fetched contents of the spec.- The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

2 个说明模块

该 Skill 对用户指定固定点与 HEAD 之间的变更进行两类审查:项目规范符合度和需求实现符合度;它使用三点 diff 按合并基点比较,并读取提交列表。

查看原文
SKILL.md:6来自说明文档打开原文件
Two-axis review of the diff between `HEAD` and a fixed point the user supplies:- **Standards**: does the code conform to this repo's documented coding standards?- **Spec**: does the code faithfully implement the originating issue / spec?
SKILL.md:21来自说明文档打开原文件
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`.

它从提交消息、用户路径或仓库目录寻找需求,并从仓库文档寻找编码规范;随后把这些资料交给独立子代理分析。提交消息引用的工单通过一个未包含在本次材料中的工作流获取,因此该获取步骤的具体权限和数据处理无法从现有证据判断。

查看原文
SKILL.md:29来自说明文档打开原文件
1. Issue references in the commit messages (`#123`, `Closes #45`, GitLab `!67`, etc.), fetched via the workflow in `docs/agents/issue-tracker.md`.2. A path the user passed as an argument.3. A spec file under `docs/`, `specs/`, or `.scratch/` matching the branch name or feature.4. If nothing is found, ask the user where the spec is. If they say there isn't one, the **Spec** sub-agent will skip and report "no spec available".
SKILL.md:36来自说明文档打开原文件
Anything in the repo that documents how code should be written, such as `CODING_STANDARDS.md` or `CONTRIBUTING.md`.
SKILL.md:58来自说明文档打开原文件
### 4. Spawn both sub-agents in parallel

最终报告保持“规范”和“需求”两类结果分离,不合并或跨类别重新排序;如果找不到需求,则跳过需求子代理并明确说明。

查看原文
SKILL.md:72来自说明文档打开原文件
If the spec is missing, skip the Spec sub-agent and note this in the final report.
SKILL.md:76来自说明文档打开原文件
Present the two reports under `## Standards` and `## Spec` headings, verbatim or lightly cleaned. Do **not** merge or rerank findings, because the two axes are deliberately separate (see _Why two axes_).End with a one-line summary: total findings per axis, and the worst issue _within each axis_ (if any). Don't pick a single winner across axes: that's the reranking the separation exists to prevent.
从这里开始 · 工作说明SKILL.md
code-review
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。
文件与检查记录2 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文
  • agents/openai.yaml已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
  • agents/openai.yaml配套文件
读取了多少行
92
文件校验值(用于核对版本)
fcc6974832133fc2d5b767ceb44f4ac095eec9d78272e14a9afa4887715d67ee