Skip to main content
QUICK REVIEW

[Paper Review] Binary Debloating for Security via Demand Driven Loading

Girish Mururu, Chris Porter|arXiv (Cornell University)|Feb 18, 2019
Security and Verification in ComputingComputer Science47 references3 citations
TL;DR

This paper proposes BlankIt, a binary-level, demand-driven loading mechanism that reduces the attack surface of C/C++ libraries by dynamically loading only the functions needed at each call site, using an input-aware decision-tree oracle. It achieves 97.2% average reduction in exposed library code and 97.9% reduction in ROP gadgets with only 18% average runtime overhead, effectively weakening control-flow hijacking attacks without recompilation.

ABSTRACT

Modern software systems heavily use C/C++ based libraries. Because of the weak memory model of C/C++, libraries may suffer from vulnerabilities which can expose the applications to potential attacks. For example, a very large number of return oriented programming gadgets exist in glibc that allow stitching together semantically valid but malicious Turing-complete programs. In spite of significant advances in attack detection and mitigation, full defense is unrealistic against an ever-growing set of possibilities for generating such malicious programs. In this work, we create a defense mechanism by debloating libraries to reduce the dynamic functions linked so that the possibilities of constructing malicious programs diminishes significantly. The key idea is to locate each library call site within an application, and in each case to load only the set of library functions that will be used at that call site. This approach of demand-driven loading relies on an input-aware oracle that predicts a near-exact set of library functions needed at a given call site during the execution. The predicted functions are loaded just in time, and the complete call chain (of function bodies) inside the library is purged after returning from the library call back into the application. We present a decision-tree based predictor, which acts as an oracle, and an optimized runtime system, which works directly with library binaries like GNU libc and libstdc++. We show that on average, the proposed scheme cuts the exposed code surface of libraries by 97.2%, reduces ROP gadgets present in linked libraries by 97.9%, achieves a prediction accuracy in most cases of at least 97%, and adds a small runtime overhead of 18% on all libraries (16% for glibc, 2% for others) across all benchmarks of SPEC 2006, suggesting this scheme is practical.

Motivation & Objective

  • To address the persistent security risk posed by bloated C/C++ libraries, especially glibc, which expose vast numbers of ROP gadgets.
  • To reduce the attack surface of linked libraries by minimizing the dynamically loaded functions at runtime.
  • To develop a practical, binary-level defense that does not require source code or recompilation of libraries.
  • To mitigate advanced control-flow hijacking attacks like ROP and JOP that bypass traditional CFI and CPI mechanisms.
  • To enable detection and prevention of non-control data attacks that CFI and CPI cannot defend against.

Proposed method

  • The system uses reverse dominance frontiers to statically identify control dependencies between call sites and library functions.
  • A decision-tree-based oracle predicts the exact set of library functions required at each call site based on input-specific behavior.
  • At runtime, only the predicted functions are loaded into memory, while all others are purged from the library’s dynamic code space.
  • The runtime system operates directly on binary libraries (e.g., glibc, libstdc++) without requiring source code or recompilation.
  • After each library call returns, the entire call chain is blanked out from memory to prevent reuse of loaded functions.
  • The approach is integrated into the application’s execution flow with minimal performance impact through optimized binary instrumentation.

Experimental results

Research questions

  • RQ1Can a demand-driven loading mechanism significantly reduce the number of dynamically linked functions and ROP gadgets in C/C++ libraries?
  • RQ2Can an input-aware oracle predict the precise set of required library functions at each call site with high accuracy?
  • RQ3Can such a mechanism reduce the attack surface without requiring source code or recompilation of libraries?
  • RQ4Does the approach remain effective against advanced attacks like ROP, JOP, and non-control data attacks that bypass CFI and CPI?
  • RQ5What is the runtime performance overhead of such a system in real-world workloads?

Key findings

  • The proposed BlankIt system reduces the average exposed code surface of linked libraries by 97.2% across SPEC2006 benchmarks.
  • ROP gadget count in linked libraries is reduced by 97.9% on average, significantly weakening control-flow hijacking capabilities.
  • The decision-tree oracle achieves a prediction accuracy of at least 97% in most cases, ensuring minimal false negatives.
  • The average runtime overhead across all SPEC2006 benchmarks is 18%, with only 16% for glibc and 2% for other libraries, indicating practicality.
  • BlankIt successfully mitigates attacks that bypass CFI and CPI, including non-control data attacks and Control-Flow Bending (CFB) exploits.
  • The system operates entirely at the binary level and does not require recompilation of any linked binaries, enabling deployment on legacy software.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.