Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3359789.3359823acmotherconferencesArticle/Chapter ViewAbstractPublication PagesacsacConference Proceedingsconference-collections
research-article
Public Access

Nibbler: debloating binary shared libraries

Published: 09 December 2019 Publication History

Abstract

Developers today have access to an arsenal of toolkits and libraries for rapid application prototyping. However, when an application loads a library, the entirety of that library's code is mapped into the address space, even if only a single function is actually needed. The unused portion is bloat that can negatively impact software defenses by unnecessarily inflating their overhead or increasing their attack surface. Recent work has explored debloating as a way of alleviating the above problems, when source code is available. In this paper, we investigate whether debloating is possible and practical at the binary level. To this end, we present Nibbler: a system that identifies and erases unused functions within shared libraries. Nibbler works in tandem with defenses like continuous code re-randomization and control-flow integrity, enhancing them without incurring additional run-time overhead. We developed and tested a prototype of Nibbler on x86-64 Linux; Nibbler reduces the size of shared libraries and the number of available functions, for real-world binaries and the SPEC CINT2006 suite, by up to 56% and 82%, respectively. We also demonstrate that Nibbler benefits defenses by showing that: (i) it improves the deployability of a continuous re-randomization system for binaries, namely Shuffler, by increasing its efficiency by 20%, and (ii) it improves certain fast, but coarse and context-insensitive control-flow integrity schemes by reducing the number of gadgets reachable through returns and indirect calls by 75% and 49% on average.

References

[1]
Martín Abadi, Mihai Budiu, Úlfar Erlingsson, and Jay Ligatti. 2005. Control-Flow Integrity. In Proc. of ACM CCS. 340--353.
[2]
Alexa. 2018. The top 500 sites on the web. https://www.alexa.com/topsites.
[3]
Kapil Anand, Matthew Smithson, Khaled Elwazeer, Aparna Kotha, Jim Gruen, Nathan Giles, and Rajeev Barua. 2013. A Compiler-level Intermediate Representation Based Binary Analysis and Rewriting System. In Proc. of EuroSys. 295--308.
[4]
Starr Andersen and Vincent Abella. 2004. Changes to Functionality in Microsoft Windows XP Service Pack 2, Part 3: Memory Protection Technologies, Data Execution Prevention. Microsoft TechNet Library. http://technet.microsoft.com/en-us/library/bb457155.aspx
[5]
Dennis Andriesse, Xi Chen, Victor van der Veen, Asia Slowinska, and Herbert Bos. 2016. An In-Depth Analysis of Disassembly on Full-Scale x86/x64 Binaries. In Proc. of USENIX SEC. 583--600.
[6]
David Bigelow, Thomas Hobson, Robert Rudd, William Streilein, and Hamed Okhravi. 2015. Timely Rerandomization for Mitigating Memory Disclosures. In Proc. of ACM CCS. 268--279.
[7]
David Brumley, Ivan Jager, Thanassis Avgerinos, and Edward J. Schwartz. 2011. BAP: A Binary Analysis Platform. In Proc. of CAV. 463--469.
[8]
David Brumley, JongHyup Lee, Edward J. Schwartz, and Maverick Woo. 2013. Native x86 Decompilation Using Semantics-Preserving Structural Analysis and Iterative Control-Flow Structuring. In Proc. of USENIX SEC. 353--368.
[9]
Yingyi Bu, Vinayak Borkar, Guoqing Xu, and Michael J. Carey. 2013. A Bloat-aware Design for Big Data Applications. In Proc. of ISMM. 119--130.
[10]
Amat Cama. 2014. Tool to generate ROP gadgets for ARM, AARCH64, x86, MIPS, PPC, RISCV, SH4 and SPARC. https://github.com/acama/xrop.
[11]
Nicolas Carlini, Antonio Barresi, Mathias Payer, David Wagner, and Thomas R. Gross. 2015. Control-Flow Bending: On the Effectiveness of Control-Flow Integrity. In Proc. of USENIX SEC. 161--176.
[12]
Sang Kil Cha, Thanassis Avgerinos, Alexandre Rebert, and David Brumley. 2012. Unleashing Mayhem on Binary Code. In Proceedings of the 2012 IEEE Symposium on Security and Privacy. 380--394.
[13]
Stephen Checkoway, Lucas Davi, Alexandra Dmitrienko, Ahmad-Reza Sadeghi, Hovav Shacham, and Marcel Winandy. 2010. Return-Oriented Programming Without Returns. In Proc. of ACM CCS. 559--572.
[14]
Xi Chen, Herbert Bos, and Cristiano Giuffrida. 2017. CodeArmor: Virtualizing the Code Space to Counter Disclosure Attacks. In Proc. of IEEE EuroS&P. 514--529.
[15]
Chromium Blog . 2012. A Tale of Two Pwnies. https://blog.chromium.org/2012/05/tale-of-two-pwnies-part-1.html.
[16]
Corelan. 2011. Corelan Repository for mona.py. https://github.com/corelan/mona.
[17]
Stephen Crane, Per Larsen, Stefan Brunthaler, and Michael Franz. 2013. Booby Trapping Software. In Proc. of NSPW. 95--106.
[18]
National Vulnerability Database. 2019. BlueKeep Vulnerability (CVE-2019-0708). NIST. https://nvd.nist.gov/vuln/detail/CVE-2019-0708
[19]
Bruce Dawson. 2013. Symbols on Linux update: Fedora Fixes. https://randomascii.wordpress.com/2013/03/05/symbols-on-linux-update-fedora-fixes/
[20]
Solar Designer. 1997. Getting around non-executable stack (and fix). BugTraq. https://seclists.org/bugtraq/1997/Aug/63
[21]
Ulrich Drepper. [n.d.]. ELF Symbol Versioning. https://www.akkadia.org/drepper/symbol-versioning.
[22]
Isaac Evans, Fan Long, Ulziibayar Otgonbaatar, Howard Shrobe, Martin Rinard, Hamed Okhravi, and Stelios Sidiroglou-Douskos. 2015. Control Jujutsu: On the Weaknesses of Fine-Grained Control Flow Integrity. In Proc. of ACM CCS. 901--913.
[23]
Michael Franz and Thomas Kistler. 1997. Slim Binaries. Commun. ACM 40, 12 (Dec. 1997), 87--94.
[24]
Cristiano Giuffrida, Anton Kuijsten, and Andrew S. Tanenbaum. 2012. Enhanced Operating System Security Through Efficient and Fine-grained Address Space Randomization. In Proc. of USENIX SEC. 475--490.
[25]
Enes Göktas, Elias Athanasopoulos, Herbert Bos, and Georgios Portokalidis. 2014. Out of Control: Overcoming Control-Flow Integrity. In Proc. of IEEE S&P. 575--589.
[26]
J. Hamilton and S. Danicic. 2009. An Evaluation of Current Java Bytecode Decompilers. In Proc. of IEEE SCAM. 129--136.
[27]
Kihong Heo, Woosuk Lee, Pardis Pashakhanloo, and Mayur Naik. 2018. Effective Program Debloating via Reinforcement Learning. In Proc. of ACM CCS. 380--394.
[28]
Hex-Rays. 2016. The IDA Pro Disassembler and Debugger. https://www.hex-rays.com/products/ida/
[29]
Patrick Horgan. [n.d.]. Linux x86 Program Start Up. http://dbp-consulting.com/tutorials/debugging/linuxProgramStartup.html.
[30]
Intel. 2013. System V Application Binary Interface. https://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf.
[31]
Y. Jiang, D. Wu, and P. Liu. 2016. JRed: Program Customization and Bloatware Mitigation Based on Static Analysis. In Proc. of IEEE COMPSAC. 12--21.
[32]
Y. Jiang, C. Zhang, D. Wu, and P. Liu. 2016. Feature-Based Software Customization: Preliminary Analysis, Formalization, and Methods. In Proc. of IEEE HASE. 122--131.
[33]
JoeDog. 2017. Siege - an http load tester and benchmarking utility. https://github.com/JoeDog/siege.
[34]
Johannes Kinder and Helmut Veith. 2010. Precise Static Analysis of Untrusted Driver Binaries. In Proc. of FMCAD. 43--50.
[35]
Hyungjoon Koo, Seyedhamed Ghavamnia, and Michalis Polychronakis. 2019. Configuration-Driven Software Debloating. In Proceedings of the 12th European Workshop on Systems Security. ACM, 9.
[36]
Anil Kurmus, Reinhard Tartler, Daniela Dorneanu, Bernhard Heinloth, Valentin Rothberg, Andreas Ruprecht, Wolfgang Schröder-Preikschat, Daniel Lohmann, and Rüdiger Kapitza. 2013. Attack Surface Metrics and Automated Compile-Time OS Kernel Tailoring. In Proc. of NDSS.
[37]
Jason Landsborough, Stephen Harding, and Sunny Fugate. 2015. Removing the Kitchen Sink from Software. In Proc. of ACM GECCO. 833--838.
[38]
John R. Levine. 1999. Linkers and Loaders (1st ed.). Morgan Kaufmann Publishers Inc., San Francisco, CA, USA.
[39]
Linux Programmer's Manual. 2018. rtld-audit - auditing API for the dynamic linker. http://man7.org/linux/man-pages/man7/rtld-audit.7.html
[40]
LLVM Project. 2018. LLVM Link Time Optimization: Design and Implementation.
[41]
Gregory Malecha, Ashish Gehani, and Natarajan Shankar. 2015. Automated Software Winnowing. In Proc. of ACM SAC. 1504--1511.
[42]
Microsoft. 2015. Control Flow Guard. Windows Dev Center. https://msdn.microsoft.com/en-us/library/windows/desktop/mt637065(v=vs.85).aspx
[43]
Microsoft. 2017. Symbols and Symbol Files. Microsoft Developer Network. https://msdn.microsoft.com/en-us/library/ff558825.aspx
[44]
Ghassan Misherghi and Zhendong Su. 2006. HDD: Hierarchical Delta Debugging. In Proc. of ICSE. 142--151.
[45]
Shachee Mishra and Michalis Polychronakis. 2018. Shredder: Breaking Exploits through API Specialization. In Proc. of ACSAC. ACM, 1--16.
[46]
Collin Mulliner and Matthias Neugschwandtner. 2015. Breaking Pay-loads with Runtime Code Stripping and Image Freezing. BHUSA. https://www.blackhat.com/us-15/briefings.html#breaking-payloads-with-runtime-code-stripping-and-image-freezing
[47]
Gail C. Murphy, David Notkin, William G. Griswold, and Erica S. Lan. 1998. An Empirical Study of Static Call Graph Extractors. ACM Trans. Softw. Eng. Methodol. 7, 2 (April 1998), 158--191.
[48]
National Security Agency. 2019. Ghidra. nsa.gov. https://www.nsa.gov/resources/everyone/ghidra/
[49]
Khanh Nguyen and Guoqing Xu. 2013. Cachetor: Detecting Cacheable Data to Remove Bloat. In Proc of ACM ESEC/FSE. 268--278.
[50]
Ben Niu and Gang Tan. 2014. Modular Control-Flow Integrity. In Proc. of ACM PLDI. 577--587.
[51]
Ben Niu and Gang Tan. 2015. Per-Input Control-Flow Integrity. In Proc. of ACM CCS. 914--926.
[52]
PaX Team. 2003. Address Space Layout Randomization (ASLR). https://pax.grsecurity.net/docs/aslr.txt
[53]
Anh Quach, Aravind Prakash, and Lok Yan. 2018. Debloating Software through Piece-Wise Compilation and Loading. In 27th USENIX Security Symposium. USENIX Association, Baltimore, MD, 869--886.
[54]
Nguyen Anh Quynh. 2014. Capstone: Next-Gen Disassembly Framework. In BHUSA.
[55]
John Regehr, Yang Chen, Pascal Cuoq, Eric Eide, Chucky Ellison, and Xuejun Yang. 2012. Test-case Reduction for C Compiler Bugs. In Proc. of PLDI. 335--346.
[56]
Jonathan Salwan. 2011. ROPgadget - Gadgets finder and auto-roper. http://shell-storm.org/project/ROPgadget/.
[57]
Sascha Schirra. 2014. Ropper - rop gadget finder and binary information tool. https://scoding.de/ropper/.
[58]
Felix Schuster, Thomas Tendyck, Christopher Liebchen, Lucas Davi, Ahmad-Reza Sadeghi, and Thorsten Holz. 2015. Counterfeit Object-oriented Programming: On the Difficulty of Preventing Code Reuse Attacks in C++ Applications. In Proc. of IEEE S&P. 745--762.
[59]
Edward J. Schwartz, Thanassis Avgerinos, and David Brumley. 2011. Q: Exploit Hardening Made Easy. In Proc. of USENIX SEC. 25--41.
[60]
Hovav Shacham. 2007. The Geometry of Innocent Flesh on the Bone: Returninto-libc Without Function Calls (on the x86). In Proc. of ACM CCS. 552--561.
[61]
Hashim Sharif, Muhammad Abubakar, Ashish Gehani, and Fareed Zaffar. 2018. TRIMMER: Application Specialization for Code Debloating. In Proc. of ACM/IEEE ASE. ACM, 329--339.
[62]
Yan Shoshitaishvili, Ruoyu Wang, Christopher Salls, Nick Stephens, Mario Polino, Audrey Dutcher, John Grosen, Siji Feng, Christophe Hauser, Christopher Kruegel, and Giovanni Vigna. 2016. SoK: (State of) The Art of War: Offensive Techniques in Binary Analysis. In IEEE Symposium on Security and Privacy. 138--157.
[63]
Kevin Z. Snow, Fabian Monrose, Lucas Davi, Alexandra Dmitrienko, Christopher Liebchen, and Ahmad-Reza Sadeghi. 2013. Just-In-Time Code Reuse: On the Effectiveness of Fine-Grained Address Space Layout Randomization. In Proc. of IEEE S&P. 574--588.
[64]
Raoul Strackx, Yves Younan, Pieter Philippaerts, Frank Piessens, Sven Lachmund, and Thomas Walter. 2009. Breaking the Memory Secrecy Assumption. In Proc. of EuroSec. 1--8.
[65]
Chengnian Sun, Yuanbo Li, Qirun Zhang, Tianxiao Gu, and Zhendong Su. 2018. Perses: Syntax-guided Program Reduction. In Proc. of ICSE. 361--371.
[66]
t0×0sh. 2014. A tool to help you write binary exploits. https://github.com/t00sh/rop-tool.
[67]
The Chromium Projects. 2018. Testing and infrastructure. https://www.chromium.org/developers/testing
[68]
Caroline Tice, Tom Roeder, Peter Collingbourne, Stephen Checkoway, Úlfar Erlingsson, Luis Lozano, and Geoff Pike. 2014. Enforcing Forward-edge Control-Flow Integrity in GCC & LLVM. In Proc. of USENIX SEC. 941--955.
[69]
TIS Committee. 1995. Tool Interface Standard (TIS)- Executable and Linking Format (ELF)- Specification- Version 1.2. http://refspecs.linuxbase.org/elf/elf.pdf.
[70]
Trail of Bits. 2019. McSema. GitHub. https://github.com/trailofbits/mcsema
[71]
Victor van der Veen, Dennis Andriesse, Enes Göktaş, Ben Gras, Lionel Sambuc, Asia Slowinska, Herbert Bos, and Cristiano Giuffrida. 2015. Practical Context-Sensitive CFI. In Proc. of ACM CCS. 927--940.
[72]
Gregor Wagner, Andreas Gal, and Michael Franz. 2011. "Slimming" a Java Virtual Machine by Way of Cold Code Removal and Optimistic Partial Program Loading. Sci. Comput. Program. 76, 11 (Nov. 2011), 1037--1053.
[73]
Shuai Wang, Pei Wang, and Dinghao Wu. 2015. Reassembleable Disassembling. In 24th USENIX Security Symposium (USENIX Security). 627--642.
[74]
Zhe Wang, Chenggang Wu, Jianjun Li, Yuanming Lai, Xiangyu Zhang, Wei-Chung Hsu, and Yueqiang Cheng. 2017. ReRanz: A Light-Weight Virtual Machine to Mitigate Memory Disclosure Attacks. In Proc. of ACM VEE. 143--156.
[75]
Richard Wartell, Yan Zhou, Kevin W. Hamlen, Murat Kantarcioglu, and Bhavani Thuraisingham. 2011. Differentiating Code from Data in x86 Binaries. In Proc. of ECML-PKDD. 522--536.
[76]
David Williams-King, Graham Gobieski, Kent Williams-King, James P. Blake, Xinhao Yuan, Patrick Colp, Michelle Zheng, Vasileios P. Kemerlis, Junfeng Yang, and William Aiello. 2016. Shuffler: Fast and Deployable Continuous Code Re-Randomization. In USENIX OSDI. 367--382.
[77]
Windows Dev Center. 2018. PE Format. https://msdn.microsoft.com/library/windows/desktop/ms680547(v=vs.85).aspx.
[78]
Patrick Wollgast, Robert Gawlik, Behrad Garmany, Benjamin Kollenda, and Thorsten Holz. 2016. Automated Multi-Architectural Discovery of CFI-Resistant Code Gadgets. In Proc. of ESORICS. 602--620.
[79]
Guoqing Xu. 2012. Finding Reusable Data Structures. In Proc. of ACM OOPSLA. 1017--1034.
[80]
Andreas Zeller and Ralf Hildebrandt. 2002. Simplifying and Isolating Failure-Inducing Input. IEEE Trans. Softw. Eng. 28, 2 (February 2002), 183--200.
[81]
Chao Zhang, Tao Wei, Zhaofeng Chen, Lei Duan, Laszlo Szekeres, Stephen McCamant, Dawn Song, and Wei Zou. 2013. Practical Control Flow Integrity and Randomization for Binary Executables. In Proc. of IEEE S&P. 559--573.
[82]
Mingwei Zhang and R. Sekar. 2013. Control Flow Integrity for COTS Binaries. In Proc. of USENIX SEC. 337--352.

Cited By

View all
  • (2024)Optimus: association-based dynamic system call filtering for container attack surface reductionJournal of Cloud Computing10.1186/s13677-024-00639-313:1Online publication date: 23-Mar-2024
  • (2024)Machine Learning Systems are Bloated and VulnerableProceedings of the ACM on Measurement and Analysis of Computing Systems10.1145/36390328:1(1-30)Online publication date: 21-Feb-2024
  • (2024)Binary Folding Compression for Efficient Software DistributionProceedings of the 39th ACM/SIGAPP Symposium on Applied Computing10.1145/3605098.3636006(169-176)Online publication date: 8-Apr-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
ACSAC '19: Proceedings of the 35th Annual Computer Security Applications Conference
December 2019
821 pages
ISBN:9781450376280
DOI:10.1145/3359789
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 09 December 2019

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. code debloating
  2. software security
  3. static binary analysis

Qualifiers

  • Research-article

Funding Sources

Conference

ACSAC '19
ACSAC '19: 2019 Annual Computer Security Applications Conference
December 9 - 13, 2019
Puerto Rico, San Juan, USA

Acceptance Rates

ACSAC '19 Paper Acceptance Rate 60 of 266 submissions, 23%;
Overall Acceptance Rate 104 of 497 submissions, 21%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)330
  • Downloads (Last 6 weeks)48
Reflects downloads up to 30 Aug 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Optimus: association-based dynamic system call filtering for container attack surface reductionJournal of Cloud Computing10.1186/s13677-024-00639-313:1Online publication date: 23-Mar-2024
  • (2024)Machine Learning Systems are Bloated and VulnerableProceedings of the ACM on Measurement and Analysis of Computing Systems10.1145/36390328:1(1-30)Online publication date: 21-Feb-2024
  • (2024)Binary Folding Compression for Efficient Software DistributionProceedings of the 39th ACM/SIGAPP Symposium on Applied Computing10.1145/3605098.3636006(169-176)Online publication date: 8-Apr-2024
  • (2024)A Hybrid System Call Profiling Approach for Container ProtectionIEEE Transactions on Dependable and Secure Computing10.1109/TDSC.2023.326812421:3(1068-1083)Online publication date: May-2024
  • (2024)Debloating Feature-Rich Closed-Source Windows Software2024 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER60148.2024.00047(400-405)Online publication date: 12-Mar-2024
  • (2024)SoK: A Tale of Reduction, Security, and Correctness - Evaluating Program Debloating Paradigms and Their CompositionsComputer Security – ESORICS 202310.1007/978-3-031-51482-1_12(229-249)Online publication date: 11-Jan-2024
  • (2023)MinimalistProceedings of the 32nd USENIX Conference on Security Symposium10.5555/3620237.3620548(5557-5573)Online publication date: 9-Aug-2023
  • (2023)Egg hunt in Tesla infotainmentProceedings of the 32nd USENIX Conference on Security Symposium10.5555/3620237.3620461(3997-4014)Online publication date: 9-Aug-2023
  • (2023)Building Dynamic System Call Sandbox with Partial Order AnalysisProceedings of the ACM on Programming Languages10.1145/36228427:OOPSLA2(1253-1280)Online publication date: 16-Oct-2023
  • (2023)Input-Driven Dynamic Program Debloating for Code-Reuse Attack MitigationProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616274(934-946)Online publication date: 30-Nov-2023
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media