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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhang, Kunpeng, Wang, Shuai, Han, Jitao, Zhu, Xiaogang, Li, Xian, Wang, Shaohua, Wen, Sheng
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913640492302336
author Zhang, Kunpeng
Wang, Shuai
Han, Jitao
Zhu, Xiaogang
Li, Xian
Wang, Shaohua
Wen, Sheng
author_facet Zhang, Kunpeng
Wang, Shuai
Han, Jitao
Zhu, Xiaogang
Li, Xian
Wang, Shaohua
Wen, Sheng
contents Deep learning (DL) libraries, widely used in AI applications, often contain vulnerabilities like buffer overflows and use-after-free errors. Traditional fuzzing struggles with the complexity and API diversity of DL libraries such as TensorFlow and PyTorch, which feature over 1,000 APIs. Testing all these APIs is challenging due to complex inputs and varied usage patterns. While large language models (LLMs) show promise in code understanding and generation, existing LLM-based fuzzers lack deep knowledge of API edge cases and struggle with test input generation. To address this, we propose DFUZZ, an LLM-driven fuzzing approach for DL libraries. DFUZZ leverages two insights: (1) LLMs can reason about error-triggering edge cases from API code and apply this knowledge to untested APIs, and (2) LLMs can accurately synthesize test programs to automate API testing. By providing LLMs with a "white-box view" of APIs, DFUZZ enhances reasoning and generation for comprehensive fuzzing. Experimental results show that DFUZZ outperforms state-of-the-art fuzzers in API coverage for TensorFlow and PyTorch, uncovering 37 bugs, with 8 fixed and 19 under developer investigation.
format Preprint
id arxiv_https___arxiv_org_abs_2501_04312
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Your Fix Is My Exploit: Enabling Comprehensive DL Library API Fuzzing with Large Language Models
Zhang, Kunpeng
Wang, Shuai
Han, Jitao
Zhu, Xiaogang
Li, Xian
Wang, Shaohua
Wen, Sheng
Software Engineering
Deep learning (DL) libraries, widely used in AI applications, often contain vulnerabilities like buffer overflows and use-after-free errors. Traditional fuzzing struggles with the complexity and API diversity of DL libraries such as TensorFlow and PyTorch, which feature over 1,000 APIs. Testing all these APIs is challenging due to complex inputs and varied usage patterns. While large language models (LLMs) show promise in code understanding and generation, existing LLM-based fuzzers lack deep knowledge of API edge cases and struggle with test input generation. To address this, we propose DFUZZ, an LLM-driven fuzzing approach for DL libraries. DFUZZ leverages two insights: (1) LLMs can reason about error-triggering edge cases from API code and apply this knowledge to untested APIs, and (2) LLMs can accurately synthesize test programs to automate API testing. By providing LLMs with a "white-box view" of APIs, DFUZZ enhances reasoning and generation for comprehensive fuzzing. Experimental results show that DFUZZ outperforms state-of-the-art fuzzers in API coverage for TensorFlow and PyTorch, uncovering 37 bugs, with 8 fixed and 19 under developer investigation.
title Your Fix Is My Exploit: Enabling Comprehensive DL Library API Fuzzing with Large Language Models
topic Software Engineering
url https://arxiv.org/abs/2501.04312