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

安全代码审查中静态分析工具的实证研究

An Empirical Study of Static Analysis Tools for Secure Code Review

Wachiraphan Charoenwet, Patanamon Thongtanunam, Van-Thuan Pham, Christoph Treude

AI总结:

本研究通过真实漏洞数据集实证评估C/C++静态分析工具在安全代码审查中的有效性,发现其能提升审查精度与召回率,但存在大量无关警告和漏检问题。

摘要:

在软件开发中早期识别安全问题对于最小化其意外影响至关重要。代码审查是一种广泛使用的人工分析方法,旨在发现软件项目中的安全问题以及其他编码问题。虽然一些研究表明自动化静态应用安全测试工具(SASTs)可以增强安全问题的识别,但关于SAST在支持安全代码审查方面的实际有效性了解有限。此外,大多数SAST研究依赖于合成或完全易受攻击版本的主题程序,这可能无法准确代表代码审查过程中的真实代码变更。\n\n为了弥补这一差距,我们使用一组实际代码变更的数据集来研究C/C++ SASTs,这些变更导致了可利用的漏洞。除了SAST的有效性,我们还量化了当变更函数被SAST警告优先排序时的潜在收益。我们的数据集包含来自92个C和C++项目中815个漏洞贡献提交(VCCs)的319个真实世界漏洞。结果显示,单个SAST可以在52%的VCCs的易受攻击函数中产生警告。使用SAST警告对变更函数进行优先排序可以提高准确性(即精确度提高12%,召回率提高5.6%),并将初始误报(检查非易受攻击函数直到第一个易受攻击函数之前的代码行数)减少13%。然而,至少76%的易受攻击函数中的警告与VCCs无关,22%的VCCs由于SAST规则的局限性而未被检测到。我们的发现强调了SAST支持的安全代码审查的益处和剩余差距,以及未来工作中应解决的挑战。

英文摘要:

Early identification of security issues in software development is vital to minimize their unanticipated impacts. Code review is a widely used manual analysis method that aims to uncover security issues along with other coding issues in software projects. While some studies suggest that automated static application security testing tools (SASTs) could enhance security issue identification, there is limited understanding of SAST's practical effectiveness in supporting secure code review. Moreover, most SAST studies rely on synthetic or fully vulnerable versions of the subject program, which may not accurately represent real-world code changes in the code review process. To address this gap, we study C/C++ SASTs using a dataset of actual code changes that contributed to exploitable vulnerabilities. Beyond SAST's effectiveness, we quantify potential benefits when changed functions are prioritized by SAST warnings. Our dataset comprises 319 real-world vulnerabilities from 815 vulnerability-contributing commits (VCCs) in 92 C and C++ projects. The result reveals that a single SAST can produce warnings in vulnerable functions of 52% of VCCs. Prioritizing changed functions with SAST warnings can improve accuracy (i.e., 12% of precision and 5.6% of recall) and reduce Initial False Alarm (lines of code in non-vulnerable functions inspected until the first vulnerable function) by 13%. Nevertheless, at least 76% of the warnings in vulnerable functions are irrelevant to the VCCs, and 22% of VCCs remain undetected due to limitations of SAST rules. Our findings highlight the benefits and the remaining gaps of SAST-supported secure code reviews and challenges that should be addressed in future work.

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

↑