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

大型语言模型是边缘用例模糊测试器:通过 FuzzGPT 测试深度学习库

Large Language Models are Edge-Case Fuzzers: Testing Deep Learning Libraries via FuzzGPT

Yinlin Deng, Chunqiu Steven Xia, Chenyuan Yang, Shizhuo Dylan Zhang, Shujing Yang, Lingming Zhang

AI总结:

本文提出 FuzzGPT 技术,通过微调和上下文学习引导大型语言模型合成异常程序以进行模糊测试,在 PyTorch 和 TensorFlow 上检测出 76 个漏洞,大幅超越 TitanFuzz。

摘要:

深度学习(DL)库的漏洞会影响下游的 DL 应用,这凸显了对可靠系统的需求。为模糊测试 DL 库生成有效的输入程序极具挑战性,因为需要同时满足语言语法/语义以及构建有效计算图的约束。最近,TitanFuzz 工作证明,现代大型语言模型(LLMs)可以被直接利用来隐式学习所有约束,从而生成有效的 DL 程序用于模糊测试。然而,LLMs 倾向于生成遵循其海量训练语料库中相似模式的普通程序,而模糊测试则青睐覆盖边缘情况或不太可能被手动生成的异常输入。为了填补这一空白,本文提出了 FuzzGPT,这是首个引导 LLMs 合成异常程序以进行模糊测试的技术。FuzzGPT 建立于一个著名假设之上:历史触发漏洞的程序可能包含对漏洞发现至关重要的罕见且有价值的代码要素。利用此类历史信息的传统技术需要大量人力来设计专用生成器并确保生成程序的有效性。FuzzGPT 证明,这一过程可以通过 LLMs 的内在能力(包括微调和上下文学习)完全自动化,同时具有泛化能力并适用于具有挑战性的领域。虽然 FuzzGPT 可应用于不同的 LLMs,但本文重点关注强大的 GPT 风格模型:Codex 和 CodeGen。此外,FuzzGPT 还展示了直接利用近期 ChatGPT 的指令遵循能力以进行有效模糊测试的潜力。在两个流行的 DL 库(PyTorch 和 TensorFlow)上的评估表明,FuzzGPT 大幅超越了 TitanFuzz,检测出 76 个漏洞,其中 49 个已被确认为此前未知的漏洞,包括 11 个高优先级漏洞或安全漏洞。

英文摘要:

Deep Learning (DL) library bugs affect downstream DL applications, emphasizing the need for reliable systems. Generating valid input programs for fuzzing DL libraries is challenging due to the need for satisfying both language syntax/semantics and constraints for constructing valid computational graphs. Recently, the TitanFuzz work demonstrates that modern Large Language Models (LLMs) can be directly leveraged to implicitly learn all the constraints to generate valid DL programs for fuzzing. However, LLMs tend to generate ordinary programs following similar patterns seen in their massive training corpora, while fuzzing favors unusual inputs that cover edge cases or are unlikely to be manually produced. To fill this gap, this paper proposes FuzzGPT, the first technique to prime LLMs to synthesize unusual programs for fuzzing. FuzzGPT is built on the well-known hypothesis that historical bug-triggering programs may include rare/valuable code ingredients important for bug finding. Traditional techniques leveraging such historical information require intensive human efforts to design dedicated generators and ensure the validity of generated programs. FuzzGPT demonstrates that this process can be fully automated via the intrinsic capabilities of LLMs (including fine-tuning and in-context learning), while being generalizable and applicable to challenging domains. While FuzzGPT can be applied with different LLMs, this paper focuses on the powerful GPT-style models: Codex and CodeGen. Moreover, FuzzGPT also shows the potential of directly leveraging the instruct-following capability of the recent ChatGPT for effective fuzzing. Evaluation on two popular DL libraries (PyTorch and TensorFlow) shows that FuzzGPT can substantially outperform TitanFuzz, detecting 76 bugs, with 49 already confirmed as previously unknown bugs, including 11 high-priority bugs or security vulnerabilities.

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

↑