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

Black-box Attacks Against Neural Binary Function Detection

Joshua Bundt, Michael Davinroy, Ioannis Agadakos, Alina Oprea, William K. Robertson

TL;DR

This paper demonstrates that current neural network-based binary analysis tools, specifically for function boundary detection, are surprisingly vulnerable to "black-box" attacks. The authors show that simple, syntactically-driven modifications can cause these tools to misclassify functions, potentially undermining their reliability in security applications.

What Problem Does This Paper Address?

Deep neural networks (DNNs) have shown great promise in various fields, including natural language processing and image recognition. Researchers have begun applying these powerful models to binary analysis – the task of understanding compiled code without source. Neural Binary Analyses (NBAs) aim to automate complex tasks like disassembly and function boundary detection, which are crucial for malware analysis and software security. However, a key question is whether these DNNs, often adapted from NLP and image domains, are truly robust when faced with the adversarial nature of real-world software security. Specifically, this paper investigates the vulnerability of neural function boundary detectors to attacks that don't require knowledge of the model's internal workings (black-box attacks).

Methods

The authors propose a general black-box vulnerability search procedure that involves several phases:

  1. Input Generation: Compiling benchmark source code using various compiler toolchains and configurations to create a diverse set of binaries.
  2. Ground Truth Generation: Extracting function boundary information from these binaries using symbol tables and debug information.
  3. Model Training and Inference: Training and evaluating the models-under-test (MUTs) on these generated binaries.
  4. Misclassification Analysis: Comparing the MUT's inferred function boundaries with the ground truth to identify false positives and false negatives.

They then categorize attacks into two types:

  • Inadvertent Attacks: These arise from compiler optimizations or configurations that, while legal, can confuse models trained on more standard inputs. Examples include stack protector mechanisms, stack clash protection, control flow integrity (CFI) instrumentation, and function alignment.
  • Adversarial Attacks: These involve intentionally crafting binary modifications to trick the model. The authors focus on injecting arbitrary byte sequences into function epilogues, demonstrating that even simple injections can be highly effective.

Datasets

The primary dataset used is BinKit, a corpus of GNU software packages compiled with various versions of GCC and Clang, and different optimization levels (e.g., -Os, -fno-inline, -fPIE). The authors expanded this corpus to include more recent compiler versions and a dataset specifically exercising Control Flow Integrity (CFI) options. For adversarial training experiments, they created a new dataset by replacing 4-byte NOP epilogues with randomly chosen evasion patterns.

Key Insights and Ideas

  • Syntax vs. Semantics: The core insight is that current NBAs, by relying on syntactic patterns (byte sequences, instruction tokens), are inherently vulnerable. They don't truly understand the meaning or semantics of the code, making them susceptible to changes that preserve functionality but alter syntax.
  • Inadvertent Attacks are Powerful: Simple compiler flags and optimization choices, designed for legitimate purposes, can significantly degrade the performance of these NBAs. This suggests that even "benign" code can be adversarial if the training data isn't representative enough.
  • Black-Box is Enough: Sophisticated white-box attacks (requiring model internals) are not necessary. Simple, unguided black-box searches are sufficient to find effective adversarial examples.
  • Domain-Specific Embeddings Offer Marginal Improvement: While tools like DeepDi, which use graph-based models and domain-specific embeddings, show some resilience compared to pure NLP-based approaches (like XDA), they are still vulnerable to adversarial attacks.
  • Adversarial Training is a Double-Edged Sword: Training models with adversarial examples can improve resilience against those specific attacks but often comes at the cost of reduced accuracy on benign inputs.

Key Results

  • XDA and DeepDi Vulnerability: Both state-of-the-art neural function boundary detectors, XDA and DeepDi, showed significant degradation in performance when subjected to inadvertent and adversarial attacks.
  • Inadvertent Attack Impact: For the CFI dataset, XDA's F1 score dropped from around 0.97 to 0.88. DeepDi also saw similar drops.
  • Adversarial Attack Impact: When adversarial mutations were introduced, XDA's F1 scores dropped significantly, and DeepDi's performance was degraded to median F1 scores well below 0.25 across different optimization levels.
  • IDA Pro Resilience: The traditional, deterministic disassembler IDA Pro remained largely unaffected by these attacks, highlighting the vulnerability of the neural approaches.
  • Improved Training Data Helps: Expanding the training dataset with more compiler variations and options improved XDA's F1 score on the CFI dataset from 0.855 to 0.924.
  • Adversarial Training Trade-offs: Training XDA on adversarial examples improved its performance on an evasion dataset from 0.198 to 0.938, but degraded its performance on the CFI dataset from 0.924 to 0.810.

Limitations and Future Work

  • Limitations:
    • The authors acknowledge that the adversarial code they inject might be detectable and removable by sophisticated static analysis techniques. However, they argue that obfuscation and opaque predicates could be used to hide such code, making detection difficult.
  • Due to DeepDi being distributed as a binary, they could not train new models for it, limiting their adversarial training experiments to XDA.
  • Future Work:
    • Investigating instruction semantics rather than purely syntactic representations for future NBA research.
  • Developing more comprehensive and representative datasets that include adversarial examples.
  • Exploring whether effective embeddings and model architectures can be specifically developed for binary analysis tasks.
  • Further research into mitigating adversarial attacks, potentially by focusing on semantic understanding rather than just syntactic patterns.

Summary updated

BibTeX
@inproceedings{bundt2023black,
  author = {Joshua Bundt and Michael Davinroy and Ioannis Agadakos and Alina Oprea and William K. Robertson},
  title = {{Black-box Attacks Against Neural Binary Function Detection}},
  booktitle = {RAID},
  year = {2023},
  doi = {10.1145/3607199.3607200},
}
Figure