DALEQ——Java字节码的可解释等价性验证
DALEQ -- Explainable Equivalence for Java Bytecode
AI总结:
针对软件二进制等价性验证缺乏可解释性的问题,研究提出daleq工具,通过反汇编Java字节码结合Datalog规则归一化实现等价判定并附证明,实验表明其可大幅降低人工成本且性能优于现有工具。
摘要:
近年来,受SolarWinds、xz等安全事件影响,软件构建的安全性受到越来越多的关注。目前,包括Oracle、Google在内的多家企业会在安全环境中重建开源项目,并通过专门仓库发布生成的二进制文件。这种做法支持将这些重建的二进制文件,与开发者生成并发布在Maven Central等仓库的原始二进制文件进行直接比对。这些二进制文件通常无法逐位完全一致,但大多数情况下差异源于构建环境的不同,二者仍可被视为等价。然而,确立这种等价性是一项耗时费力且容易出错的工作。\n现有部分工具可用于该场景,但均无法提供溯源信息,即可读解释说明两个二进制文件等价或不等价的原因。为解决这一问题,我们提出daleq工具:它将Java字节码反汇编到关系数据库中,并可通过应用Datalog规则对该数据库进行归一化处理,随后可利用这些数据库推断两个类之间的等价性。值得注意的是,等价性判定结果会附带记录归一化过程的Datalog证明。我们通过一项大规模评估验证了daleq在工业场景中的效用:评估涉及2714对jar包,包含265690个类对,实验中将daleq与两款现有的字节码转换工具进行对比。结果表明,daleq大幅减少了评估非逐位等价制品所需的人工工作量——这类工作原本需要大量人工检查。此外,结果显示daleq的表现优于现有工具:即使不存在行为差异,它也能识别出更多由相同代码重建的制品为等价制品。
英文摘要:
The security of software builds has attracted increased attention in recent years in response to incidents like solarwinds and xz. Now, several companies including Oracle and Google rebuild open source projects in a secure environment and publish the resulting binaries through dedicated repositories. This practice enables direct comparison between these rebuilt binaries and the original ones produced by developers and published in repositories such as Maven Central. These binaries are often not bitwise identical; however, in most cases, the differences can be attributed to variations in the build environment, and the binaries can still be considered equivalent. Establishing such equivalence, however, is a labor-intensive and error-prone process. While there are some tools that can be used for this purpose, they all fall short of providing provenance, i.e. readable explanation of why two binaries are equivalent, or not. To address this issue, we present daleq, a tool that disassembles Java byte code into a relational database, and can normalise this database by applying datalog rules. Those databases can then be used to infer equivalence between two classes. Notably, equivalence statements are accompanied with datalog proofs recording the normalisation process. We demonstrate the impact of daleq in an industrial context through a large-scale evaluation involving 2,714 pairs of jars, comprising 265,690 class pairs. In this evaluation, daleq is compared to two existing bytecode transformation tools. Our findings reveal a significant reduction in the manual effort required to assess non-bitwise equivalent artifacts, which would otherwise demand intensive human inspection. Furthermore, the results show that daleq outperforms existing tools by identifying more artifacts rebuilt from the same code as equivalent, even when no behavioral differences are present.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。