arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2202.03013cs.CRcs.SE
收藏

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

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

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

摘要:

Fuzzing是发现软件缺陷最有效的方法之一。然而,将其应用于微控制器固件会带来许多挑战。例如,基于重新宿主的解决方案不能准确地对外围设备行为进行建模,因此不能用于模糊对应的驱动程序代码。在这项工作中,我们提出了$μ$ AFL,硬件在环的方法来模糊微控制器固件。它利用现有的嵌入式系统开发中的调试工具,构建一个AFL兼容的模糊框架。具体来说,我们使用调试软件狗来桥接PC上的模糊环境和微控制器设备上的目标固件。为了收集代码覆盖率信息而无需昂贵的代码插装,$μ$ AFL依赖于ARM ETM硬件调试功能,该功能透明地收集指令跟踪并将结果流式传输到PC。然而,原始ETM数据是模糊的,并且需要巨大的计算资源来恢复实际的指令流。因此,我们提出了一种替代表示的代码覆盖率,它保留了相同的路径敏感性作为原始的AFL算法,但可以直接工作的原始ETM数据,而不匹配它们与反汇编指令。为了进一步减少工作量,我们使用DWT硬件功能来选择性地收集感兴趣的运行时信息。我们在恩智浦和意法半导体两家主要供应商提供的两块真实评估板上对$μ$ AFL进行了评估。通过我们的原型,我们在意法半导体SDK附带的驱动程序代码中发现了10个零日漏洞,在恩智浦SDK中发现了3个零日漏洞。已为他们分配了8个社区教育机会。考虑到供应商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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑