Skip to main content
QUICK REVIEW

[论文解读] Greybox fuzzing as a contextual bandits problem

Ketan Patil, Aditya Kanade|arXiv (Cornell University)|Jun 11, 2018
Software Testing and Debugging Techniques参考文献 15被引用 12
一句话总结

该论文提出了一种上下文Bandit框架,以替代AFL灰盒模糊测试中基于启发式的能量分配机制,通过策略梯度方法学习策略,根据测试用例的固定长度子串动态分配模糊测试迭代次数。该方法在大多数二进制文件上提升了覆盖率,证明了强化学习在智能模糊测试能量分配中的可行性。

ABSTRACT

Greybox fuzzing is one of the most useful and effective techniques for the bug detection in large scale application programs. It uses minimal amount of instrumentation. American Fuzzy Lop (AFL) is a popular coverage based evolutionary greybox fuzzing tool. AFL performs extremely well in fuzz testing large applications and finding critical vulnerabilities, but AFL involves a lot of heuristics while deciding the favored test case(s), skipping test cases during fuzzing, assigning fuzzing iterations to test case(s). In this work, we aim at replacing the heuristics the AFL uses while assigning the fuzzing iterations to a test case during the random fuzzing. We formalize this problem as a `contextual bandit problem' and we propose an algorithm to solve this problem. We have implemented our approach on top of the AFL. We modify the AFL's heuristics with our learned model through the policy gradient method. Our learning algorithm selects the multiplier of the number of fuzzing iterations to be assigned to a test case during random fuzzing, given a fixed length substring of the test case to be fuzzed. We fuzz the substring with this new energy value and continuously updates the policy based upon the interesting test cases it produces on fuzzing.

研究动机与目标

  • 解决AFL中基于启发式的能量分配的局限性,后者常因忽略测试用例内容而导致过度或不足模糊测试。
  • 将灰盒模糊测试中的能量分配问题形式化为上下文Bandit问题,以实现最优决策。
  • 开发并集成一种基于局部测试用例子串选择能量倍数的可学习策略,使用策略梯度方法。
  • 在真实世界二进制文件上评估该方法,并与标准AFL配置的覆盖率表现进行比较。
  • 探索用学习模型替代AFL中多个启发式规则的可能性,以提升模糊测试效率。

提出的方法

  • 将能量分配问题形式化为上下文Bandit问题,其中上下文为测试用例的固定长度子串。
  • 使用神经网络策略预测给定测试用例子串的能量倍数(模糊测试迭代次数)。
  • 使用策略梯度方法训练策略,基于模糊测试过程中发现的新分支的反馈进行更新。
  • 将学习到的模型集成到AFL的模糊测试循环中,替代其基于启发式的能量分配机制。
  • 基于使用指定能量模糊测试某个测试用例后发现的新分支覆盖率,构建奖励信号。
  • 使用TensorFlow实现系统,并在多个大规模二进制文件上进行评估,包括跨二进制实验。

实验结果

研究问题

  • RQ1上下文Bandit框架能否有效替代AFL在灰盒模糊测试中基于启发式的能量分配?
  • RQ2基于测试用例局部子串的学习是否能带来比固定启发式能量分配更好的覆盖率?
  • RQ3与标准AFL配置相比,学习到的策略在时间维度上的分支覆盖率表现如何?
  • RQ4该模型能否在不同二进制文件之间泛化,尤其是同一软件套件(如binutils)中的二进制文件?
  • RQ5强化学习在多大程度上能减少模糊测试中对手工编写启发式规则的依赖?

主要发现

  • 所提出的上下文Bandit方法在大多数评估的二进制文件上实现了比标准AFL更具优势的分支覆盖率,尤其是在确定性阶段。
  • 该模型在覆盖率随时间的变化上表现与基线AFL相当或更优,尤其是在针对相关二进制文件进行训练时。
  • 跨二进制实验表明,该模型在binutils二进制文件之间具有合理的泛化能力,表明其在相似软件间具备可迁移性。
  • 该系统成功集成到AFL中,并利用TensorFlow实现,为未来基于强化学习的模糊测试增强提供了可扩展性。
  • 尽管该模型在许多目标上优于标准AFL的覆盖率,但在无确定性阶段的AFL配置下性能略逊一筹,表明超参数调优仍有空间。
  • 结果表明,用学习策略替代AFL的启发式规则是可行的,并可带来更高的模糊测试效率。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。