arXivDaily arXiv每日学术速递 周一至周五更新
稍安勿躁,官方尚未更新
arXiv 2502.03365cs.SEcs.CRcs.LG
收藏

天作之合?基于AI的漏洞与安全单元测试匹配

A Match Made in Heaven? AI-driven Matching of Vulnerabilities and Security Unit Tests

Hamburg University of Technology(汉堡理工大学)

Emanuele Iannone, Quang-Cuong Bui, Riccardo Scandariato

AI总结:

VuTeCo通过AI技术自动收集漏洞见证测试案例,提升安全单元测试的生成与匹配效率。

摘要:

软件漏洞通常通过污点分析、渗透测试或模糊测试来检测。它们也通过单元测试发现,这些测试使用特定输入来测试安全敏感行为,称为漏洞见证测试。生成式AI模型可以帮助开发人员编写这些测试,但它们需要许多示例来学习,而这些示例目前很少。本文介绍了VuTeCo,一个基于AI的框架,用于从Java仓库中收集漏洞见证测试的示例。VuTeCo执行两项任务:(1)“发现”任务,确定单元测试案例是否与安全相关;(2)“匹配”任务,将测试案例与它所见证的漏洞相关联。VuTeCo通过UniXcoder解决发现任务,在Vul4J的单元测试测试集中实现了F0.5得分为0.73,精确度为0.83。匹配任务使用DeepSeek Coder解决,实现了F0.5得分为0.65,精确度为0.75。VuTeCo已在427个Java项目和1,238个漏洞上实际应用,获得了224个被确认为安全相关的测试案例和35个正确匹配到29个漏洞的测试。这些验证的测试被收集到一个新的数据集Test4Vul中。VuTeCo为大规模检索漏洞见证测试奠定了基础,使未来的AI模型能够更好地理解和生成安全单元测试。

英文摘要:

Software vulnerabilities are often detected via taint analysis, penetration testing, or fuzzing. They are also found via unit tests that exercise security-sensitive behavior with specific inputs, called vulnerability-witnessing tests. Generative AI models could help developers in writing them, but they require many examples to learn from, which are currently scarce. This paper introduces VuTeCo, an AI-driven framework for collecting examples of vulnerability-witnessing tests from Java repositories. VuTeCo carries out two tasks: (1) The "Finding" task to determine whether a unit test case is security-related, and (2) the "Matching" task to relate a test case to the vulnerability it witnesses. VuTeCo addresses the Finding task with UniXcoder, achieving an F0.5 score of 0.73 and a precision of 0.83 on a test set of unit tests from Vul4J. The Matching task is addressed using DeepSeek Coder, achieving an F0.5 score of 0.65 and a precision of 0.75 on a test set of pairs of unit tests and vulnerabilities from Vul4J. VuTeCo has been used in the wild on 427 Java projects and 1,238 vulnerabilities, obtaining 224 test cases confirmed to be security-related and 35 tests correctly matched to 29 vulnerabilities. The validated tests were collected in a new dataset called Test4Vul. VuTeCo lays the foundation for large-scale retrieval of vulnerability-witnessing tests, enabling future AI models to better understand and generate security unit tests.

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

↑