AI Patch Diffing: Find What a Security Update Fixed (Ghidra + ghidriff)
Use when someone wants to find what a security update changed in a binary (Patch Tuesday, a vendor fix, a 1-day root cause) using free tools: ghidriff (Ghidra-based binary diffing) plus an LLM to triage the changed functions. Gives getting the before and after binaries, running the diff, ranking changes, asking the model the right questions, and honest limits from published results.
by skillstore33 · MIT
The skill
Use when someone wants to find what a security update changed in a binary (Patch Tuesday, a vendor fix, a 1-day root cause) using free tools: ghidriff (Ghidra-based binary diffing) plus an LLM to triage the changed functions. Gives getting the before and after binaries, running the diff, ranking changes, asking the model the right questions, and honest limits from published results.
AI Patch Diffing: Find What a Security Update Fixed (Ghidra + ghidriff)
Rule for using this skill: Confirm the goal is defensive (understanding a fix to prioritize patching, write detections, or assess exposure) and that they're entitled to the binaries. Get both versions, diff with ghidriff, rank the changed functions, then use the model to explain the top few, verifying each claim. Don't produce working exploits.
What patch diffing is
Compare the unpatched and patched versions of a binary to find the functions that changed, then work out which change is the security fix and what it fixed. Defenders use it to judge how urgent a patch is and to write detections.
1. Get the two versions
- Windows updates: the vulnerable and fixed versions of the same file (for example a
.sysor.dll) from the update before and the update that fixed the CVE. Keep the file version numbers and hashes. - Open-source or vendor software: the release before and after the advisory.
- Store both with their versions in your notes: everything else depends on having the right pair.
2. Diff with ghidriff
ghidriff is a free command-line binary differ built on Ghidra's headless analyzer.
- Install Ghidra and set
GHIDRA_INSTALL_DIR. - Install ghidriff:
pip install ghidriff(in a virtual environment). - Run it on the pair:
ghidriff old.dll new.dll. - It writes a Markdown report: added, deleted and modified functions, with side-by-side decompiled diffs.
Large binaries take a while; the first analysis is the slow part.
3. Rank the changes before involving a model
A security update often changes dozens of functions. Shortlist by:
- Small, targeted changes in functions that handle input: parsing, lengths, sizes, buffers, copying.
- New checks: added comparisons, bounds checks, integer-overflow checks,
ifreturns that bail out early. - Names and strings matching the advisory's component (the CVE text often names the feature).
- Ignore changes from recompilation noise (renumbered addresses, reordered code with the same logic).
4. Ask the LLM focused questions
For each shortlisted function, give the model the before and after decompiled code and the advisory text, and ask:
- "What does the new code check that the old code didn't?"
- "Which input reaches this check, and from where?"
- "What would have happened in the old version when that check fails?"
- "Answer with line references, and say what you can't determine."
Then turn the answer into a root-cause summary and detection ideas, not an exploit.
5. Know the limits
Published results are humbling:
- Bishop Fox reported LLM-ranked patch diffs placing the real fix in the top 5 in 0% of the cases it showed.
- Akamai's PatchDiff-AI works but relies on IDA and BinDiff.
So the model helps you read changes faster; it doesn't reliably find the fix on its own. Your ranking (step 3) and verification (dynamic tests in a VM, a second tool) do the heavy lifting.
Sources
- Akamai, Patch Wednesday root-cause analysis with LLMs: https://www.akamai.com/blog/security-research/patch-wednesday-root-cause-analysis-with-llms ; https://github.com/akamai/patchdiff-ai
- Bishop Fox, vulnerability discovery with LLM-powered patch diffing: https://bishopfox.com/blog/vulnerability-discovery-with-llm-powered-patch-diffing
- Patch2Vuln: https://arxiv.org/html/2605.06601
- ghidriff: https://github.com/clearbluejar/ghidriff
Use this skill
Connect your agent to the Skill Store MCP server and ask for it by ref: skillstore33/ai-patch-diffing-ghidra-ghidriff-55622999913.
Details
- Publisher
- skillstore33
- Category
- Security › Application security
- License
- MIT
- Updated
- 2026-11-30
References
More from skillstore33
Acrylic Color Reference Cards on White and Black Know exactly how your colors mix before you paint
Stencils, Mouth Atomizer and Glue Gun Stencil Techniques Spray and sponge crisp patterns with homemade stencils
Staging Action and Reaction in Storyboards Show action, character reaction and pacing clearly across panels
Drawing Characters of Different Ages Make babies, kids, teens, adults and seniors read at a glance