Binary Diff Summarization using Large Language Models

Meet Udeshi, Venkata Sai Charan Putrevu, Prashanth Krishnamurthy, Prashant Anantharaman, Sean Carrick, Ramesh Karri, Farshad Khorrami · DOI

Introduction

Software supply chain security has become a critical concern for modern cybersecurity. Malicious actors increasingly target legitimate software updates to inject backdoors, as seen in high-profile incidents like the SolarWinds and 3CX compromises. Detecting these injections often requires "binary diffing"—comparing two versions of a program without access to source code. However, traditional tools merely identify structural changes, leaving human analysts to manually reverse-engineer assembly code to determine if a change is benign or malicious. This process is labor-intensive and error-prone. This paper presents a novel framework that leverages Large Language Models (LLMs) to automate the summarization of binary differences and triage suspicious code changes.

Methodology: The Analysis Pipeline

The proposed framework transforms raw binary differences into actionable natural language insights through a multi-stage pipeline.

Overview of the binary diff summarization and malware prediction pipeline.

The process begins with Ghidriff, a tool built on the Ghidra decompiler, which identifies added, deleted, or modified functions. These functions are then mapped into a Diff Callgraph. To ensure contextual accuracy, the system processes functions in a "reverse breadth-first" order, summarizing low-level utility functions before analyzing the high-level functions that call them.

The core of the analysis is LLM Summarization. For each changed function, an LLM generates a functional summary and a "diff summary" that explicitly describes the behavioral shift. To quantify the risk of these changes, the authors introduce the Functional Sensitivity Score (FSS).

Functional Sensitivity Scoring (FSS)

Inspired by the Common Vulnerability Scoring System (CVSS), the FSS provides a standardized metric (0–10) to rank the security implications of a code change. The score is derived from five key categories: sensitive behaviors (e.g., process forking), resource access (e.g., network or file system interaction), and impacts on confidentiality, integrity, and availability.

Example of the LLM prompt and response flow, illustrating the generation of functional summaries and FSS scores.

By focusing on the "semantic shift"—such as a memory cleanup function suddenly opening a network socket—the LLM can flag high-risk anomalies that structural diffing tools would miss. Finally, the system aggregates these scores to predict whether an entire update is "MALICIOUS" or "BENIGN."

Experimental Evaluation

The framework was evaluated using a custom benchmark consisting of six popular open-source projects (e.g., openssl, sqlite). The researchers manually injected various malware types, including ransomware, remote access trojans (RATs), and botnets, resulting in a dataset of 392 binary diffs across 46,000 functions.

Key Results

  • Precision and Recall: The system achieved a high precision of 0.98, significantly reducing "alert fatigue" by ensuring that flagged updates are almost certainly malicious. The recall stood at 0.64, indicating success in detecting nearly two-thirds of the injected samples.
  • XZ Utils Case Study: The framework successfully detected the real-world XZ Utils backdoor (CVE-2024-3094). It correctly identified the injected malicious functions, assigned them high FSS scores, and flagged the update as malicious.
  • Triage Efficiency: FSS proved to be an effective filter; malicious functions scored an average of 3.0 points higher than benign ones, allowing analysts to focus on the most suspicious 1% of changes.

Discussion and Limitations

A key insight from the study is the importance of model synergy. While some models excelled at code summarization, others were better at final classification. A hybrid approach—using specialized models for different stages—yielded the best performance.

However, several limitations remain. The system's recall is limited when malware is distributed across many small, subtle changes. Furthermore, the analysis is dependent on the quality of the decompiler; obfuscated code that produces "junk" assembly will lead to poor LLM summaries. Finally, the computational cost of processing tens of thousands of functions via LLM APIs remains a practical hurdle for widespread adoption.

Conclusion

By combining automated binary decompilation with the semantic reasoning capabilities of LLMs, this framework bridges the "understanding gap" in binary diffing. The introduction of the FSS provides a scalable way to triage software updates, offering a powerful new tool for defending the software supply chain.

Summary updated

BibTeX
@misc{udeshi2025binary,
  author = {Meet Udeshi and Venkata Sai Charan Putrevu and Prashanth Krishnamurthy and Prashant Anantharaman and Sean Carrick and Ramesh Karri and Farshad Khorrami},
  title = {{Binary Diff Summarization using Large Language Models}},
  year = {2025},
  eprint = {2509.23970},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.23970},
}
Figure