patch-diff-research
它能做什么
这项技能说明如何研究安全补丁、构建一个能体现差异的测试,并查找类似的代码问题。适合获得授权检查代码的安全研究人员和维护者。
适用场景
- ✓当安全审查人员要求智能体比较其有权检查的项目的漏洞版本与修复版本时。
- ✓当智能体需要找出与已修补漏洞具有相同成因的相邻代码路径时。
- ✓当报告需要展示旧版本上的正向测试和修复版本上的反向对照时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/patch-diff/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我比较这个项目的漏洞版本与修复版本,并检查类似的代码路径是否仍存在同样的问题?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体锁定两个版本,说明补丁改动了什么,构建一个在旧版本上失败、在修复版本上通过的测试,然后逐一检查每个类似位置。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Patch-Diff Research
Use this workflow only on source, commits, and test targets the engagement is authorized to inspect. A patch is evidence of a changed security boundary, not proof that every neighboring line is exploitable.
Inputs
- Pinned vulnerable and fixed revisions from the same repository.
- Build instructions and a local or intentionally vulnerable test target.
- The advisory, failing test, or exact behavior corrected by the patch.
Loop
- Pin both sides. Record repository URL, vulnerable commit, fixed commit, clean working-tree state, dependency lockfile hashes, and build commands.
- Explain the security delta. Identify the source, guard, sink, trust boundary, and behavior changed by the patch. Ignore formatting-only hunks.
- Build a differential test. The positive case must reproduce on the vulnerable revision; the negative control is the exact same case on the fixed revision. Record both raw outputs.
- Search for siblings. Search only for the abstract cause—not the exact line text. For every hit, confirm framework, data flow, authorization state, and reachability before treating it as a candidate.
- Validate candidates independently. Each candidate gets its own minimal
positive and baseline command through
validate_workspace_finding. Do not inherit validation from the original CVE. - Report the boundary. Record rejected siblings and why they differ. Group only independently confirmed findings under the common root cause.
Required artifacts
research/patch-diff/<advisory>/
revisions.json # commits and dependency hashes
security-delta.md # source / guard / sink explanation
original-positive.txt # vulnerable revision output
original-fixed-control.txt # fixed revision output
variants/<candidate>/positive.txt
variants/<candidate>/baseline.txt
variants/<candidate>/verification.json
A variant is promotable only when its own verification artifact validates and the original fixed-side control demonstrates the intended remediation boundary.
常见问题
为什么要比较两个版本?
该技能指出,补丁标明了安全边界所在的位置,因此其他地方的类似代码可能需要同样的修复。
补丁能证明其他代码存在漏洞吗?
不能。该技能指出,补丁只是边界被改动的证据,每个相邻位置在报告之前都必须逐一检查。
报告必须包含哪些内容?
必须包含提交信息、两个版本上的测试结果,以及对每个候选问题的验证。
详情
作者的原始描述
Authorized patch-diff workflow for deriving and validating vulnerability variants from a known vulnerable-to-fixed source change.
热度
- GitHub 星标
- 6.5k
- 排名
- #13963
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …