NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Semantic Learning and Emulation Based Cross-platform Binary Vulnerability Seeker

Jian Gao, Yu Jiang, Zhe Liu, Xin Yang, Cong Wang, Xun Jiao, Zijiang Yang, Jiaguang SunIEEE Trans. Software Eng 2021 · DOI

TL;DR

This paper introduces BinSeeker, a novel approach for finding vulnerabilities in compiled software (binaries) that works across different architectures and compilers. By combining semantic learning to quickly narrow down potential candidates and semantic emulation for precise verification, BinSeeker achieves significantly higher accuracy and efficiency than existing methods.

What Problem Does This Paper Address?

Software reuse is common, meaning vulnerabilities in one piece of code can propagate to many others. Detecting these vulnerabilities in source code is challenging enough, but it becomes even harder when dealing with compiled binaries. This is because the same source code can produce vastly different binaries depending on the compiler, its settings, and the target architecture (e.g., x86, ARM). Traditional source-code-based vulnerability detection methods fail here. Existing binary analysis tools struggle with either accuracy (semantic learning methods) or efficiency (emulation-based methods), especially when dealing with large codebases and cross-platform challenges. This paper aims to bridge this gap by developing a tool that is both accurate and efficient for cross-platform binary vulnerability searching.

Methods

BinSeeker employs a two-stage approach:

  1. Semantic Learning (Fast Filtering):
    • Labeled Semantic Flow Graph (LSFG): Instead of just using Control Flow Graphs (CFGs), BinSeeker constructs LSFGs that combine CFGs with Data Flow Graphs (DFGs). This richer representation captures more function semantics, making it more robust to structural differences caused by different compilers or architectures.
  2. Feature Extraction: Basic blocks within the LSFG are represented by a set of 8 lightweight features (e.g., number of stack operations, arithmetic instructions, library calls).
  3. Customized Deep Neural Network: A Siamese network architecture, adapted from the structure2vec model, is used. This network takes two LSFGs as input and outputs an embedding vector for each, representing their semantic similarity. The goal is to quickly identify a relatively large set (M) of candidate functions that are semantically similar to a known vulnerable function.
  4. Semantic Emulation (Accurate Verification):
    • Argument Recognition: BinSeeker identifies function arguments (register and stack) from disassembled code.
  5. Function Emulation: It emulates the execution of the candidate functions identified in the first stage. This involves converting assembly to an intermediate representation (VEX-IR) and then executing it with generated arguments.
  6. Dynamic Signature Generation: During emulation, BinSeeker records a "semantic signature" of the function's execution trace (inputs, outputs, library calls, etc.).
  7. Similarity Calculation: The Jaccard similarity coefficient is used to compare the semantic signatures of the candidate functions with the signature of the known vulnerable function. This stage produces a refined list of top-N functions that are most behaviorally similar to the vulnerability.

Datasets

  • Dataset I: Used for training the semantic learning model. It consists of binaries from three open-source software (BusyBox, OpenSSL, Coreutils) compiled with two compilers (GCC, Clang) and four optimization levels (00-03) across three architectures (x86, ARM, MIPS). This resulted in 368,256 functions and 4,673K basic blocks.
  • Dataset II: Used for evaluating vulnerability search accuracy and efficiency. It includes widely-used real-world programs (OpenSSL, Coreutils, curl, Wget) compiled with various configurations, known for having difficult-to-detect cross-platform vulnerabilities.

Key Insights and Ideas

  • LSFG is Key: Combining CFGs with DFGs (LSFG) provides a more robust semantic representation for binary functions, crucial for cross-platform analysis.
  • Two-Stage Approach Pays Off: The combination of fast semantic learning for initial filtering and precise semantic emulation for verification offers a superior balance of accuracy and efficiency compared to using either method alone.
  • Semantic Emulation is Costly but Accurate: While semantic emulation is computationally expensive, applying it only to a small, pre-filtered set of candidates (M) makes it practical.
  • Feature Engineering Matters: A carefully selected set of 8 basic block features proved more effective than those used by other learning-based methods.

Key Results

  • Accuracy: BinSeeker achieved a Mean Reciprocal Rank (MRR) of 0.65, significantly outperforming Genius (0.17), Gemini (0.07), and CACompare (0.42). Its top-5 accuracy was 93.33%, compared to 33.33%, 13.33%, and 53.33% for the others.
  • Efficiency: BinSeeker determined if a target binary function contained a known vulnerability in an average of 0.27 seconds, compared to 1.57s (Genius), 0.15s (Gemini), and 0.98s (CACompare).
  • Time Cost: For a program with an average of 1,895 functions, BinSeeker took 504 seconds on average, while Genius took 2,976s and CACompare took 1,857s.

Limitations and Future Work

  • False Negatives/Positives: Like most security tools, BinSeeker is not immune to false negatives and positives. The authors suggest increasing the parameter M (number of initial candidates) to reduce false negatives, though this increases computation.
  • Binary Obfuscation: Code obfuscation can significantly alter control and data flow structures, impacting BinSeeker's performance. Future work could involve deobfuscation techniques.
  • Function Inlining: Compiler optimizations like function inlining can affect the analysis. The authors suggest exploring inline decision algorithms.
  • Future Work: The authors plan to improve the robustness of the semantic emulator and apply BinSeeker to more platforms.

Summary updated

BibTeX
@article{gao2021semantic,
  author = {Jian Gao and Yu Jiang and Zhe Liu and Xin Yang and Cong Wang and Xun Jiao and Zijiang Yang and Jiaguang Sun},
  title = {{Semantic Learning and Emulation Based Cross-platform Binary Vulnerability Seeker}},
  journal = {IEEE Trans. Software Eng.},
  year = {2021},
  doi = {10.1109/tse.2019.2956932},
}
Figure