论文标题

$μ$ AFL:微控制器固件的非侵入反馈驱动的模糊

$μ$AFL: Non-intrusive Feedback-driven Fuzzing for Microcontroller Firmware

论文作者

Li, Wenqiang, Shi, Jiameng, Li, Fengjun, Lin, Jingqiang, Wang, Wei, Guan, Le

论文摘要

模糊是查找软件缺陷的最有效方法之一。但是,将其应用于微控制器固件会面临许多挑战。例如,基于重新主持的解决方案无法准确地对外围行为进行建模,因此不能用来模糊相应的驱动程序代码。在这项工作中,我们提出了$μ$ AFL,这是一种用于模糊微控制器固件的硬件方法。它利用现有嵌入式系统开发中的调试工具来构建与AFL兼容的模糊框架。具体来说,我们使用调试加密狗在PC上和微控制器设备上的目标固件上弥合模糊环境。为了收集无代码仪器的代码覆盖信息,$μ$ AFL依赖于ARM ETM硬件调试功能,该功能透明地收集了指令跟踪并将结果流式传输到PC。但是,RAW ETM数据晦涩难懂,需要巨大的计算资源来恢复实际的指令流。因此,我们提出了代码覆盖范围的替代表示,该表示保留了与原始AFL算法相同的路径敏感性,但可以直接在RAW ETM数据上使用,而无需与拆卸指令匹配它们。为了进一步减少工作量,我们使用DWT硬件功能有选择地收集感兴趣的运行时信息。我们在两个主要供应商的两个真实评估板上评估了$μ$ AFL:NXP和Stmicroelectronics。有了我们的原型,我们发现了用STMicroelectronics的SDK和NXP SDK中的SDK SDK运送的驱动程序代码中的十个零日错误。八个CVE已分配给他们。考虑到供应商SDK在真实产品中的广泛采用,我们的结果令人震惊。

Fuzzing is one of the most effective approaches to finding software flaws. However, applying it to microcontroller firmware incurs many challenges. For example, rehosting-based solutions cannot accurately model peripheral behaviors and thus cannot be used to fuzz the corresponding driver code. In this work, we present $μ$AFL, a hardware-in-the-loop approach to fuzzing microcontroller firmware. It leverages debugging tools in existing embedded system development to construct an AFL-compatible fuzzing framework. Specifically, we use the debug dongle to bridge the fuzzing environment on the PC and the target firmware on the microcontroller device. To collect code coverage information without costly code instrumentation, $μ$AFL relies on the ARM ETM hardware debugging feature, which transparently collects the instruction trace and streams the results to the PC. However, the raw ETM data is obscure and needs enormous computing resources to recover the actual instruction flow. We therefore propose an alternative representation of code coverage, which retains the same path sensitivity as the original AFL algorithm, but can directly work on the raw ETM data without matching them with disassembled instructions. To further reduce the workload, we use the DWT hardware feature to selectively collect runtime information of interest. We evaluated $μ$AFL on two real evaluation boards from two major vendors: NXP and STMicroelectronics. With our prototype, we discovered ten zero-day bugs in the driver code shipped with the SDK of STMicroelectronics and three zero-day bugs in the SDK of NXP. Eight CVEs have been allocated for them. Considering the wide adoption of vendor SDKs in real products, our results are alarming.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源