paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Your Fix Is My Exploit: Enabling Comprehensive DL Library API Fuzzing with Large Language Models

你的修复就是我的漏洞利用:利用大语言模型实现全面的深度学习库 API 模糊测试
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 5/10 · 论文将 LLM 用于 DL 库 API 模糊测试,属于在机器学习系统上应用程序分析与测试,且问题驱动、有工业库落地,与用户 PL→AI 方向有部分重叠;但其核心是动态模糊测试而非静态分析/形式化验证,也未涉及浮点程序分析或贝叶斯程序分析,因此匹配度中等。引用 6 inbox
Kunpeng Zhang, Shuai Wang, Jitao Han, Xiaogang Zhu, Xian Li, Shaohua Wang, Sheng Wen
crossref: 2026-09-12

AI 速览

一句话:提出 DFuzz,让 LLM 从 API 源码检查中推理边界输入并生成测试程序,实现 DL 库 API 的全面模糊测试。

深度学习库(如 TensorFlow、PyTorch)API 数量已超 1000 个且持续增长,其中存在缓冲区溢出、释放后使用、整数溢出等漏洞,但传统模糊测试难以应对其复杂性与 API 使用模式的多样性;现有的基于 LLM 的模糊测试器又缺乏对 API 输入边界情况的深入知识,且测试输入生成效率低下。本文提出 DFuzz:一方面利用 LLM 的推理能力,从 API 代码中的检查条件出发推断可能触发错误的边界输入,并将抽取到的知识迁移到新的或很少被测试的 API 上;另一方面利用 LLM 的生成能力,高准确率地合成初始测试程序以自动化 API 测试。DFuzz 为 LLM 提供了一种新颖的 API「白盒视角」,从而实现更全面的模糊测试。实验表明 DFuzz 在 TensorFlow 与 PyTorch 上覆盖的 API 数量均超过当前最优的基于 LLM 的模糊测试器,并成功检测到 37 个缺陷,其中 8 个已修复、19 个已被开发者复现且仍在调查中。

问题
DL 库 API 数量庞大、实现复杂且输入数据与使用模式多样,传统模糊测试与现有基于 LLM 的模糊测试器都难以对 API 进行充分覆盖,尤其是难以触达易引发漏洞的输入边界情况。
方法
DFuzz 为 LLM 提供 API 的「白盒视角」:让 LLM 从 API 源码中的检查条件推理出可能触发错误的边界输入,并将该知识迁移到新的或冷门 API;同时利用 LLM 的生成能力自动合成高准确率的初始测试程序来驱动 API 测试。
评估
在主流 DL 库上与最先进的基于 LLM 的模糊测试器对比 API 覆盖率(TensorFlow 与 PyTorch),并统计实际发现的缺陷数量及其修复/复现状态。
原文摘要(Abstract)

Deep learning (DL) libraries are widely used to form the basis of various AI applications in computer vision, natural language processing, and software engineering domains. Despite their popularity, DL libraries are known to have vulnerabilities, such as buffer overflows, use-after-free, and integer overflows, that can be exploited to compromise the security or effectiveness of the underlying libraries. While traditional fuzzing techniques have been used to find bugs in software, they are not well-suited for DL libraries. In general, the complexity of DL libraries and the diversity of their APIs make it challenging to test them thoroughly. To date, mainstream DL libraries like TensorFlow and PyTorch have featured over 1,000 APIs, and the number of APIs is still growing. Fuzzing all these APIs is a daunting task, especially when considering the complexity of the input data and the diversity of the API usage patterns. Recent advances in large language models (LLMs) have illustrated the high potential of LLMs in understanding and synthesizing human-like code. Despite their high potential, we find that emerging LLM-based fuzzers are less optimal for DL library API fuzzing, given their lack of in-depth knowledge on API input edge cases and inefficiency in generating test inputs. In this paper, we propose DFuzz, a LLM-driven DL library fuzzing approach. We have two key insights: (1) With high reasoning ability, LLMs can replace human experts to reason edge cases (likely error-triggering inputs) from checks in an API's code, and transfer the extracted knowledge to test other (new or rarely-tested) APIs. (2) With high generation ability, LLMs can synthesize initial test programs with high accuracy that automates API testing. DFuzz provides LLMs with a novel “white-box view” of DL library APIs, and therefore, can leverage LLMs' reasoning and generation abilities to achieve comprehensive fuzzing. Our experimental results on popular DL libraries demonstrate that DFuzz is able to cover more APIs than SOTA (LLM-based) fuzzers on TensorFlow and PyTorch, respectively. Moreover, DFuzz successfully detected 37 bugs, with 8 already fixed and 19 replicated by the developer but still under investigation.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8904,
  title = {Your Fix Is My Exploit: Enabling Comprehensive DL Library API Fuzzing with Large Language Models},
  author = {Kunpeng Zhang and Shuai Wang and Jitao Han and Xiaogang Zhu and Xian Li and Shaohua Wang and Sheng Wen},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00041}
}