When vulnerabilities are discovered after software is deployed, source code is often unavailable, and binary patching may be required to mitigate the vulnerability. However, manually patching binaries is time-consuming, requires significant expertise, and does not scale to the rate at which new vulnerabilities are discovered. To address these problems, we introduce Partially Recompilable Decompilation (PRD), which extracts and decompiles suspect binary functions to source where they can be patched or analyzed, applies transformations to enable recompilation of these functions (partial recompilation), then employs binary rewriting techniques to create a patched binary. Although decompilation and recompilation do not universally apply, PRD's fault localization identifies a function subset that is small enough to admit decompilation and large enough to address many vulnerabilities. Our approach succeeds because decompilation is limited to a few functions and lifting facilitates analysis and repair. To demonstrate the scalability of PRD, we evaluate it in the context of a fully automated end-to-end scenario that relies on source-level Automated Program Repair (APR) methods to mitigate the vulnerabilities. We also evaluate PRD in the context of human-generated source-level repairs. In the end-to-end experiment, PRD produced test-equivalent binaries in 84% of cases; and the patched binaries incur no significant run-time overhead. When combined with APR tools and evaluated on the DARPA Cyber Grand Challenge (CGC) benchmarks, PRD achieved similar success rates as the winning CGC entries, while presenting repairs as source-level patches which can be reviewed by humans; In some cases, PRD finds higher-quality mitigations than those produced by top CGC teams. We also demonstrate that PRD successfully extends to real-world binaries and binaries that are produced from languages other than C.
翻译:当在软件部署后发现脆弱性,源代码往往不可用,并且可能需要二进制补丁来减轻脆弱性。然而,人工补丁二进制过程耗费时间,需要大量专业知识,且不至于与发现新脆弱性的速度相适应。为了解决这些问题,我们引入了部分可调解分解功能(PRD),它提取和分解怀疑二进制功能到可以补补补或分析这些功能的来源,应用转换使这些功能(部分重新编译)能够重新编译,然后使用二进制重写技术来创建一个补补的二进制二进制。虽然手补补补二进的二进制过程耗费时间,但并不普遍适用,但PRD的本地化发现一个小的功能组,足以承认分解,大到足以解决许多脆弱性。我们的方法之所以成功,是因为分解功能仅限于少数功能,提升和修复。为了证明PRD,我们用一个完全自动的端到尾端假设,我们用一个完全自动的版本的版本来进行补补补补补补补。 在IMRD的版本中,我们还可以进行大量的升级的升级的升级的C,在测试中也能够评估。