Engineer working on a laptop connected to a device test rig, surrounded by wiring harnesses and test hardware

Firmware vulnerabilities & fixes

Firmware binary diffing and patch analysis: finding silently-fixed vulnerabilities

Last updated:

Firmware binary diffing compares two versions of the same firmware image — typically a device's currently deployed build against a newly released update — at the function and basic-block level to find exactly what changed, because vendor release notes routinely say little more than "security improvements" without naming the vulnerability fixed.

The resulting diff becomes the only public record of what was actually wrong, and it cuts both ways: an analyst uses it to understand and triage an n-day risk still present on every device running the older image, and an attacker uses the same diff to reconstruct the bug a vendor never disclosed.

Key takeaways

  • Silent patching is common, not an exception.
  • Comparing two firmware builds byte-for-byte mostly fails, because a recompile — even with no logic changes at all — can shift every function's address, reorder sections and change compiler-generated padding.
  • Every function-level differ needs a disassembler underneath; the extraction tools feed them but do not diff anything themselves.
  • The walk-through below is a synthetic, labelled example: the product, versions, binary and function names are made up to show the workflow, not taken from any real vendor.

Why do vendors patch firmware without saying what they fixed?

Silent patching is common, not an exception. A security fix bundled into a routine firmware update competes for release-note space with feature changes and bug fixes that have nothing to do with security, and a vendor weighing early disclosure against giving attackers a blueprint often chooses brevity. NIST frames the underlying problem — not the silence itself, but why patching discipline matters regardless of how much a vendor says — directly in NIST SP 800-40r4, the Guide to Enterprise Patch Management Planning: "there are many in the world who continuously search for and exploit flaws in software," which is exactly why a device still running the pre-patch image stays exposed for as long as the patch sits undeployed, whether or not its advisory text ever named the flaw. A firmware fleet with dozens of SKUs and a slow update cadence (see our firmware OTA update security guide for what a healthy update pipeline actually checks) can leave that gap open for months.

Open-source projects are held to a stricter standard than many device vendors hold themselves. The OpenSSF Best Practices criterion release_notes_vulns says release notes "MUST identify every publicly known run-time vulnerability fixed in this release that already had a CVE assignment or similar." Our OpenSSF badge guide covers that criterion; when a firmware vendor's notes fall short of it, diffing is how you find out what changed.

How does structural binary diffing actually identify a changed function?

Comparing two firmware builds byte-for-byte mostly fails, because a recompile — even with no logic changes at all — can shift every function's address, reorder sections and change compiler-generated padding. BinDiff, described in its own manual as "the leading executable-comparison tool for reverse engineers that need to analyze patches, malware variants, or are generally interested in the differences between two executables," instead works on structure: "every function gets a signature, based on the structure of the (normalized) flow graph of the function," built from the number of codeblocks, the number of edges between them, and the number of calls to subfunctions. Functions whose signature occurs exactly once in each binary become an initial match; from there BinDiff uses callgraphs "to generate more matches," progressively drilling down through ambiguous cases to basic-block-level comparison inside each matched function pair.

Step What it does Typical tool
1. Unpack both images Extract bootloader, kernel, filesystems and individual binaries from the pre-patch and post-patch firmware binwalk, unblob
2. Identify matching binaries Pair up the same named executable or library across both unpacked trees File/path matching, component inventory
3. Structural function match Match functions between the two binaries by flow-graph signature and callgraph, not raw address BinDiff, or the open-source Diaphora
4. Classify the diff Separate "identical," "matched but changed" and "added/removed" functions BinDiff's match confidence/similarity score
5. Triage changed functions Decide which changed function is a security fix versus an unrelated refactor or feature change Analyst review, cross-referenced against any CVE/advisory text

The manual is specific about how that score is built. A function's similarity is a weighted sum: about 25% the share of matched flow-graph edges, 15% matched basic blocks, 10% matched instructions and 50% the difference in flow-graph MD index. "The final similarity value is multiplied by confidence," because "even a seemingly good match is not trustworthy if produced by weak algorithms." In practice, sort matched functions by similarity and start just below 1.0: a security fix usually adds a check or a branch, so the function stays matched while its graph changes a little.

A function that keeps an identical structural signature between the two builds is unchanged — safe to ignore for this purpose. A function whose flow graph changed shape, especially one touching input parsing, memory handling or an authentication check, is exactly where to look first; our weak cryptography in embedded firmware and memory corruption in embedded firmware guides cover what those changed functions tend to look like once found.

Which diffing tools exist, and what does each need?

Every function-level differ needs a disassembler underneath; the extraction tools feed them but do not diff anything themselves.

Tool Role What it needs / licence Note from its own docs
BinDiff Function and basic-block diffing Open source since version 8, Apache 2.0; exports from IDA Pro, Binary Ninja or Ghidra via BinExport Lets researchers "identify and isolate fixes for vulnerabilities in vendor-supplied patches"
Diaphora Function, graph and pseudo-code diffing IDA plugin (IDA 7.4 or later); AGPL-3.0 Lists "potentially fixed vulnerabilities detection for patch diffing sessions"
Ghidra Version Tracking Matching code and data between two binaries Built into Ghidra Main use: port comments and labels to a newer version of an analysed binary
radiff2 Byte, delta, code-analysis and graph diffing Part of radare2, command line Compares "at various levels, from raw data to disassembled code"
binwalk v3 Extraction Rust rewrite "identify, and optionally extract, files and data that have been embedded inside of other files"
unblob Extraction MIT, command line or Python library Parses "more than 30 different archive, compression, and file-system formats"

Sources: each tool's README, manual or official documentation, read 2026-11-12.

BinDiff's own disassembler page ranks IDA Pro as its fully integrated option and lists Binary Ninja and Ghidra at its lowest support tier, which still requires manual export steps — worth knowing before a team standardises on a free disassembler.

What does a firmware patch diff look like, step by step?

The walk-through below is a synthetic, labelled example: the product, versions, binary and function names are made up to show the workflow, not taken from any real vendor.

A gateway vendor ships firmware 3.1.8 with release notes reading "stability and security improvements."

  1. Collect both imagesand record their hashes: the deployed 3.1.7 and the new 3.1.8.
  2. Check whether either image is encryptedbefore extracting anything; a flat, near-maximum entropy profile means the extractor will find nothing useful (see our firmware entropy guide).
  3. Extract bothwith binwalk or unblob into two directory trees.
  4. Diff the inventories firstBuild an SBOM for each tree and compare them; in this example the bundled SSH server moved one patch version and every other package is unchanged. The free SBOM diff tool does this comparison in the browser.
  5. Pick the binaries to diff at function level: the SSH server (to confirm the upstream fix) and the vendor's own web daemon gwhttpd, whose package version did not change but whose file hash did.
  6. Load each pair into the disassembler, export, and run BinDiffIn gwhttpd, 1,204 functions match identically, 3 match with similarity below 1.0, and 1 function is new.
  7. Read the three changed functionsTwo differ only in a logging string; the third, the query-string parser, gained a length comparison before a copy into a fixed-size stack buffer, and the new function is a bounds-checked copy helper.
  8. Write the finding down: binary, function, version pair, what changed and why it looks like a memory-safety fix. That is evidence for patch priority on your own fleet, and for a disclosure question to the vendor.

Step 4 is what keeps the work manageable: it tells you which of hundreds of binaries are worth loading at all.

What does a component-level diff catch that a function diff misses?

The two levels answer different questions, and a firmware team usually needs both:

Question Component (SBOM) diff Function (BinDiff-style) diff
Which third-party packages changed version? Yes, directly Only by inference, binary by binary
Which known CVEs did the update close or introduce? Yes, once each version is matched against NVD/KEV No, it has no vulnerability data
What changed inside the vendor's own code? No, version strings often stay the same Yes, that is its purpose
Was a fix backported without a version bump? No Yes, if you know which binary to look at
What does it cost to run? Automated once each image has an SBOM Analyst time for every binary pair

Why does a silent fix turn into an n-day risk so quickly?

The short answer is that diffing a patch is not a theoretical shortcut — it has been a demonstrated, automatable technique for well over a decade. Brumley, Poosankam, Song and Zheng's 2008 IEEE Symposium on Security and Privacy paper, Automatic Patch-Based Exploit Generation is Possible: Techniques and Implications, generated exploits automatically for 5 Microsoft programs from the patches delivered through Windows Update, "usually within a few minutes," with the fastest end-to-end run under 30 seconds. The authors note that their techniques "may not work in all cases," but conclude that automatic patch-based exploit generation "should be considered practical." The same paper cites a measurement that Windows Update took about 24 hours to see 80% of the hosts checking for a patch, which is the window an attacker with the patch in hand gets. That result is the concrete reason "the release notes didn't mention a CVE" buys a device maker far less time than it appears to: the moment an update is public, every device still on the older image is running known-vulnerable code whether or not that vulnerability has a public identifier. CISA's Known Exploited Vulnerabilities (KEV) catalog exists for the same reason from the defender's side — tracking what is actually being exploited in the wild, not only what a vendor chose to describe — and pairing KEV with FIRST's EPSS score is the practical way to prioritize which diffed finding needs a fix shipped first; see our KEV and EPSS prioritization guide for how that scoring actually works, and our NIST SP 800-40 guide for the patch-planning side.

What are the common firmware-diffing pitfalls?

  • Diffing compressed blobs. Unextracted images mostly show that filesystem headers moved.
  • Comparing builds from different toolchains. A compiler upgrade changes inlining and register allocation across the whole binary, burying the real fix in noise; check the compiler banner strings first.
  • Ignoring stripped binaries. Without symbols, name-based matching is gone and more functions land in the low-confidence pile; expect more manual review.
  • Trusting high similarity blindly. A one-instruction bounds fix can leave similarity near 1.0, so read every changed function, not only the most changed ones.
  • Missing moved functionality. A check deleted from one function and added to a new helper shows up as "changed" plus "added"; read them together.
  • Skipping the inventory step. Function diffing every binary in a full image is rarely practical; the component diff tells you where to look.

What does SoftWSP automate in this workflow?

The inventory side, not the function-level side. SoftWSP's automated pipeline does not run BinDiff-style, function-level structural diffing — that is the specialist analyst workflow described above, done by a person with BinDiff or Diaphora against two unpacked images. What a SoftWSP scan does is the binary-analysis identification our firmware SBOM guide covers: unpack an image, identify the software components and versions present, write them as a CycloneDX 1.6 SBOM, and match each component version against NVD, CISA's KEV catalog, FIRST's EPSS scores and CISA's CSAF ICS advisories. Each image is its own analysis, so a before-and-after comparison means scanning both images and comparing the two exported SBOMs, for example in the SBOM diff tool; the platform has no built-in image-to-image comparison.

AI's role is narration, not detection, on top of that deterministic matching: it drafts the plain-language report for each matched component and vulnerability, every sentence citing the specific component, version and CVE/KEV/EPSS record behind it, the same evidence-citing rule SoftWSP applies to every report it produces. An engineer reviews every finding before it ships. If a changed binary's version alone doesn't explain a known fix, that is a job for an analyst with function-level diffing tools — SoftWSP does not claim its automated scan performs that deeper structural comparison, and it does not judge reachability.

See our OWASP Firmware Security Testing Methodology guide for where this kind of component-level comparison fits into a full testing workflow, or device & firmware security services for getting a specific firmware update diffed.

This guide draws on the BinDiff manual (zynamics/Google) and google/bindiff repository, the Diaphora, binwalk and Ghidra Version Tracking documentation, the radare2 book, unblob.org, Brumley et al.'s 2008 IEEE S&P paper, NIST SP 800-40r4, the OpenSSF Best Practices criteria and CISA's KEV catalog, read directly 2026-11-12.

Put this guide to work

Frequently asked questions

What is firmware binary diffing, and why does it matter for n-day vulnerabilities?

Firmware binary diffing compares two versions of the same firmware image — usually a currently deployed release against a newly published update — at the function and basic-block level to find exactly what changed, because vendor release notes routinely say "security improvements" without naming the fixed vulnerability. The diff itself becomes the only public evidence of what was actually wrong, which is also why it matters for attackers: once a patch is public, diffing it against the pre-patch image can point straight at the vulnerable code path, turning an undisclosed bug into a practical, working n-day exploit for anyone still running the old image.

How does a tool like BinDiff actually identify which function changed?

BinDiff does not compare raw bytes or assembly instructions directly, since a recompile can shift every address without changing any logic. Its own manual describes a structural approach instead: "every function gets a signature, based on the structure of the (normalized) flow graph of the function," built from "number of codeblocks, number of edges between codeblocks, number of calls to subfunctions"; functions whose signature is unique in both binaries become initial matches, and the tool then uses callgraphs "to generate more matches," drilling down to basic-block-level comparison inside each matched function pair. A function with a structurally identical signature in both images is unchanged; one whose flow graph changed shape between the pre-patch and post-patch build is exactly the function to look at first.

What is the role of binwalk if the actual comparison is done by a different tool?

binwalk doesn't diff anything; it unpacks. Its own README describes it as a tool to "identify, and optionally extract, files and data that have been embedded inside of other files," which is the step that has to happen before a function-level diff is even possible — pulling the kernel, bootloader and individual binaries out of two full firmware images so the same named executable in each can be loaded side by side into a comparison tool. Skipping that step and diffing the raw firmware blobs directly mostly just finds that compressed filesystem headers moved, not that a function changed.

Can binary diffing alone turn a patch into a working exploit?

Diffing identifies and narrows down *where* a fix landed; turning that into a working exploit is separate, harder work, but the two are closer together than most teams assume. Brumley, Poosankam, Song and Zheng's 2008 IEEE Symposium on Security and Privacy paper, "Automatic Patch-Based Exploit Generation is Possible: Techniques and Implications," demonstrated that an automated system comparing a patched binary against its pre-patch version could automatically generate a working exploit for the vulnerability the patch fixed (it did so for 5 Microsoft programs patched through Windows Update) — which is the concrete, published reason "the vendor didn't explain the CVE" is not the safety margin it looks like, and why CISA's Known Exploited Vulnerabilities catalog exists to track which gaps are already being hit in practice rather than which ones a vendor chose to describe.

Does SoftWSP run automated binary function-level diffing (BinDiff-style matching) on firmware?

No. SoftWSP's automated pipeline identifies the software components and versions present inside each firmware image (the same binary-analysis process our firmware SBOM guide covers) and matches each one against known CVE, CISA KEV and FIRST EPSS data, across both the before and after image, so an engineer can see which components changed version and which vulnerabilities that change actually closed. Function-level, BinDiff-style structural diffing to pinpoint the exact instructions a patch touched is a specialist analyst workflow this guide describes, not something SoftWSP's product runs automatically — the gap between "this component's version changed" and "this specific function was rewritten to fix a bug" still needs a human analyst with a tool like BinDiff or Diaphora.

Sources

  1. zynamics/Google: BinDiff Manual — Understanding BinDiff (matching algorithm)
  2. ReFirmLabs: binwalk — Firmware Analysis Tool (GitHub README)
  3. D. Brumley, P. Poosankam, D. Song, J. Zheng, "Automatic Patch-Based Exploit Generation is Possible: Techniques and Implications," 2008 IEEE Symposium on Security and Privacy
  4. NIST SP 800-40r4: Guide to Enterprise Patch Management Planning (April 2022, Final)
  5. CISA: Known Exploited Vulnerabilities (KEV) Catalog
  6. google/bindiff: BinDiff source repository (open source, Apache 2.0) and supported disassemblers
  7. Diaphora: program diffing plugin for IDA (README)
  8. Ghidra: Version Tracking Introduction (official help page)
  9. The Official Radare2 Book: radiff2
  10. unblob: extraction suite documentation (ONEKEY)
  11. OpenSSF Best Practices Badge: passing criteria (release_notes_vulns)
Was this guide helpful?

In this cluster

Firmware binary diffing and patch analysis: finding silently-fixed vulnerabilities