The widespread code reuse allows vulnerabilities to proliferate among a vast variety of firmware. There is an urgent need to detect these vulnerable code effectively and efficiently. By measuring code similarities, AI-based binary code similarity detection is applied to detecting vulnerable code at scale. Existing studies have proposed various function features to capture the commonality for similarity detection. Nevertheless, the significant code syntactic variability induced by the diversity of IoT hardware architectures diminishes the accuracy of binary code similarity detection. In our earlier study and the tool Asteria, we adopt a Tree-LSTM network to summarize function semantics as function commonality and the evaluation result indicates an advanced performance. However, it still has utility concerns due to excessive time costs and inadequate precision while searching for large-scale firmware bugs. To this end, we propose a novel deep learning enhancement architecture by incorporating domain knowledge-based pre-filtration and re-ranking modules, and we develop a prototype based on Asteria called Asteria-Pro. Pre-filtration module seeks to eliminates dissimilar functions to boost subsequent deep learning model calculations, while re-ranking module aims to raises the rankings of vulnerable functions among candidates generated by deep learning model. Our evaluation indicates that pre-filtration module cuts the calculation time by 96.9% and re-ranking improves MRR and Recall by 23.71% and 36.4%. By incorporating the pre-filtration and re-ranking modules, Asteria-Pro outperforms existing state-of-the-art approaches in bug search task, by a significant large margin. We conduct a large-scale real-world firmware bug search and Asteria-Pro manages to detect 1,482 vulnerable functions with a high precision 91.65%.
翻译:广度的代码再利用使得大量各种固态器件之间容易扩散。 迫切需要有效和高效地检测这些脆弱的代码。 通过测量代码相似性, 使用基于 AI 的二进制代码相似性检测来大规模检测脆弱代码。 现有的研究提出了各种功能特征来捕捉相似性检测的共性。 然而, 由IoT 硬件结构多样性引起的大量代码混杂性降低了二进制代码相似性检测的准确性。 在我们早先的研究和工具Asteria中, 我们采用树- LSTM 网络, 将功能的语义汇总为函数共性, 而评价结果显示一种先进的性能。 然而, 仍然对基于 AI 的二进制代码类似性代码进行检测。 但是, 在搜索大型固态器器错误时, 仍然对使用基于基于知识的预过滤和重新排位模块, 我们开发了一个基于 Asteria 的称为 Asterdia-Protrial。 预过滤模块旨在消除不相异性功能, 推进了随后的深层次学习模型计算, 而重新定位模块的目的是提高我们内部的排序中的易变的动作。