arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2204.02545cs.CRcs.SE
收藏

有状态灰盒模糊测试

Stateful Greybox Fuzzing

Jinsheng Ba, Marcel Böhme, Zahra Mirzamomen, Abhik Roychoudhury

AI总结:

针对协议实现中需特定状态才能触发的缺陷,本文提出自动识别 enum 具名常量状态变量并跟踪状态序列的有状态灰盒模糊测试方法,显著提升状态覆盖、代码覆盖和漏洞发现效率。

摘要:

许多协议实现都是反应式系统,其中协议进程会持续与其他进程及环境进行交互。如果某个缺陷只有在特定状态下才能暴露,模糊测试器就需要提供特定的事件序列作为输入,使协议在缺陷显现之前进入该状态。我们将这类缺陷称为“有状态”缺陷。通常,在测试协议实现时,我们并没有详细的协议形式化规范可以依赖。在缺乏协议知识的情况下,模糊测试器发现这类有状态缺陷本质上十分困难。因此,一个关键挑战是在没有显式协议规范的情况下覆盖状态空间。\n在本文中,我们主张有状态协议模糊测试可以避免用于状态识别的人工标注。具体而言,我们依赖一种程序化直觉:协议实现中使用的状态变量通常表现为 enum 类型变量,其取值(即状态名称)来自具名常量。在对使用最广泛的 Top-50 开源协议实现进行分析时,我们发现每个实现都使用被赋予具名常量的状态变量(例如 INIT、READY 等易于理解的名称)来表示当前状态。本文提出自动识别这类状态变量,并在模糊测试过程中跟踪赋予它们的值序列,从而生成已探索状态空间的“地图”。\n实验证实,我们的有状态模糊测试器发现有状态缺陷的速度是其所扩展的基线灰盒模糊测试器的两倍。从初始状态出发,我们的模糊测试器执行的状态/迁移序列数量多出一个数量级,并且代码覆盖速度达到基线模糊测试器的两倍。我们的模糊测试器还在知名协议实现中发现了若干零日缺陷,并且已获得 8 个 CVE 编号。

英文摘要:

Many protocol implementations are reactive systems, where the protocol process is in continuous interaction with other processes and the environment. If a bug can be exposed only in a certain state, a fuzzer needs to provide a specific sequence of events as inputs that would take protocol into this state before the bug is manifested. We call these bugs as "stateful" bugs. Usually, when we are testing a protocol implementation, we do not have a detailed formal specification of the protocol to rely upon. Without knowledge of the protocol, it is inherently difficult for a fuzzer to discover such stateful bugs. A key challenge then is to cover the state space without an explicit specification of the protocol. In this work, we posit that manual annotations for state identification can be avoided for stateful protocol fuzzing. Specifically, we rely on a programmatic intuition that the state variables used in protocol implementations often appear in enum type variables whose values (the state names) come from named constants. In our analysis of the Top-50 most widely used open-source protocol implementations, we found that every implementation uses state variables that are assigned named constants (with easy to comprehend names such as INIT, READY) to represent the current state. In this work, we propose to automatically identify such state variables and track the sequence of values assigned to them during fuzzing to produce a "map" of the explored state space. Our experiments confirm that our stateful fuzzer discovers stateful bugs twice as fast as the baseline greybox fuzzer that we extended. Starting from the initial state, our fuzzer exercises one order of magnitude more state/transition sequences and covers code two times faster than the baseline fuzzer. Several zero-day bugs in prominent protocol implementations were found by our fuzzer, and 8 CVEs have been assigned.

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

↑