Abstract: This paper proposes LATTE, the first static binary taint analysis that is powered by a large language model (LLM). LATTE is superior to the state of the art (e.g., Emtaint, Arbiter, Karonte) in three aspects. First, LATTE is fully automated while prior static binary taint analyzers need rely on human expertise to manually customize taint propagation rules and vulnerability inspection rules. Second, LATTE is significantly effective in vulnerability detection, demonstrated by our comprehensive evaluations. For example, LATTE has found 37 new bugs in real-world firmware which the baselines failed to find, and 7 of them have been assigned CVE numbers. Lastly, LATTE incurs remarkably low engineering cost, making it a cost-efficient and scalable solution for security researchers and practitioners. We strongly believe that LATTE opens up a new direction to harness the recent advance in LLMs to improve vulnerability analysis for binary programs.
The Semantic Gap in Binary Analysis
Taint analysis is a fundamental technique in security auditing, used to track the flow of untrusted data from a "source" to a sensitive "sink." If data reaches a sink without proper neutralization, a vulnerability occurs. However, performing this analysis on compiled binary files is notoriously difficult. Unlike source code, binaries lack variable names, types, and comments, creating a significant "semantic gap."
Existing state-of-the-art tools, such as Arbiter or Karonte, attempt to bridge this gap by requiring human experts to manually write complex rules for every new library or vulnerability type. This process is slow, error-prone, and fails to scale. While traditional tools are proficient at tracking low-level data movement, they often fail to understand the high-level intent of the code.
Methodology: The LATTE Approach
LATTE (LLM-Powered Binary Taint Analyzer) addresses these challenges by combining traditional program slicing with the semantic reasoning capabilities of Large Language Models (LLMs). The system operates through a four-stage pipeline:
- Preprocessing: The binary is disassembled and decompiled into pseudo-C code using Ghidra.
- Semantic Identification: Instead of relying on manual lists, LATTE utilizes an LLM to identify potential sources (e.g.,
recv,fgets) and sinks (e.g.,system,strcpy) within the binary's external calls. - Dangerous Flow Extraction: Using static analysis, LATTE performs backward slicing from sinks to sources to identify "Dangerous Flows" (DFs)—sequences of functions where untrusted data might trigger a bug.
- Prompt Sequencing: To manage LLM context limits and prevent hallucinations, LATTE employs a structured conversation. It analyzes the flow function-by-function, maintaining the "taint" state through a sequence of Start, Middle, and End prompts, eventually asking the LLM for a final vulnerability judgment.
Evaluation and Real-World Impact
LATTE was evaluated against the Juliet Test Suite (v1.3) and a real-world dataset of 49 firmware samples from major vendors like NETGEAR and TP-Link. The results demonstrate that LATTE significantly outperforms specialized tools in both breadth and accuracy.
On the Juliet suite, LATTE achieved an average accuracy of 81.44%. In real-world firmware, it identified 119 unique bugs, including 37 previously unknown vulnerabilities that all baseline tools missed. To date, 10 of these have been assigned CVE numbers. Furthermore, LATTE is highly efficient, with an average analysis time of 20 seconds per subject and a cost of approximately $0.35 per dangerous flow.
Conclusion
LATTE demonstrates that LLMs can effectively bridge the semantic gap in binary analysis. By automating rule generation and providing resilient semantic understanding, it offers a scalable, cost-effective alternative to manual auditing. While limitations remain regarding complex math and indirect calls, LATTE represents a significant step forward in automated vulnerability research.
Summary updated