一句话:为结构化输入的灰盒模糊测试引入语法感知的裁剪与变异策略,显著提升覆盖率与漏洞发现能力。
覆盖引导的灰盒模糊测试在实践中非常有效,但 AFL 等工具在处理 XML、JavaScript 等结构化输入时,其语法盲的裁剪与变异策略会严重制约效率与效果。本文提出一种语法感知的覆盖引导灰盒模糊测试方法:在已知测试输入语法(通常公开可得)的前提下,利用解析后输入 AST 在树层面进行裁剪,并设计两种语法感知变异策略——增强的字典变异与基于树的变异(通过 AST 替换子树),使模糊测试的探索能够同时扩展到宽度与深度。作者将该方法实现为 AFL 的扩展原型 Superion,并在大规模真实程序上评估:XML 引擎 libplist 以及 WebKit、Jerryscript、ChakraCore 三个 JavaScript 引擎。结果表明,相较于 AFL 与 jsfunfuzz,Superion 在行覆盖率和函数覆盖率上分别提升 16.7% 与 8.8%,并发现 34 个新 bug,其中 22 个为新漏洞,获得 19 个 CVE 编号与 3.2K 美元赏金。
In recent years, coverage-based greybox fuzzing has proven itself to be one of the most effective techniques for finding security bugs in practice. Particularly, American Fuzzy Lop (AFL for short) is deemed to be a great success in fuzzing relatively simple test inputs. Unfortunately, when it meets structured test inputs such as XML and JavaScript, those grammar-blind trimming and mutation strategies in AFL hinder the effectiveness and efficiency. To this end, we propose a grammar-aware coverage-based greybox fuzzing approach to fuzz programs that process structured inputs. Given the grammar (which is often publicly available) of test inputs, we introduce a grammar-aware trimming strategy to trim test inputs at the tree level using the abstract syntax trees (ASTs) of parsed test inputs. Further, we introduce two grammar-aware mutation strategies (i.e., enhanced dictionary-based mutation and tree-based mutation). Specifically, tree-based mutation works via replacing subtrees using the ASTs of parsed test inputs. Equipped with grammar-awareness, our approach can carry the fuzzing exploration into width and depth. We implemented our approach as an extension to AFL, named Superion; and evaluated the effectiveness of Superion using large- scale programs (i.e., an XML engine libplist and three JavaScript engines WebKit, Jerryscript and ChakraCore). Our results have demonstrated that Superion can improve the code coverage (i.e., 16.7% and 8.8% in line and function coverage) and bug-finding capability (i.e., 34 new bugs, among which we discovered 22 new vulnerabilities with 19 CVEs assigned and 3.2K USD bug bounty rewards received) over AFL and jsfunfuzz.