arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2510.15512cs.SE
收藏

通过模糊测试和可能不变量增强代码审查

Enhancing Code Review through Fuzzing and Likely Invariants

Singapore Management University(新加坡管理大学)

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

AI总结:

FuzzSight利用非崩溃模糊输入的可能不变量,突出代码版本间行为差异,以标记回归缺陷和漏洞,在审查中实现高检测率与低误报。

摘要:

许多软件项目采用人工代码审查来在代码集成前把关缺陷和漏洞。然而,审查者常常在时间压力下工作,主要依赖静态检查,导致程序的动态方面未被探索。动态分析可以揭示此类行为,但很少被整合到审查中。其中,模糊测试通常稍后用于发现崩溃性错误。然而,其使用多样化输入执行代码的能力使其有望更早地暴露非崩溃但意外的行为。尽管如此,由于缺乏合适的机制来分析程序行为,模糊测试期间产生的丰富数据对审查者仍然不可及,限制了其在此场景中的实际价值。我们假设程序行为的意外变化可能表明潜在缺陷。代码变更的影响可以在运行时自动捕获。将程序行为表示为可能不变量(即在特定程序点一致观察到的动态属性)可以提供行为变化的实用信号。此类信号提供了一种区分预期变更与代码变更导致的意外行为变化的方法。我们提出了FuzzSight,一个利用非崩溃模糊测试输入中的可能不变量来突出程序版本间行为差异的框架。通过揭示这些差异,它提供了哪些代码块可能需要更密切关注的见解。在我们的评估中,FuzzSight标记了75%的回归缺陷和24小时模糊测试发现的至多80%的漏洞。它在识别有缺陷的代码块方面也优于SAST,实现了十倍高的检测率且误报更少。总之,FuzzSight展示了利用模糊测试和不变量分析进行早期代码审查的潜力和价值,将静态检查与动态行为见解桥接起来。

英文摘要:

Many software projects employ manual code review to gatekeep defects and vulnerabilities in the code before integration. However, reviewers often work under time pressure and rely primarily on static inspection, leaving the dynamic aspects of the program unexplored. Dynamic analyses could reveal such behaviors, but they are rarely integrated into reviews. Among them, fuzzing is typically applied later to uncover crashing bugs. Yet its ability to exercise code with diverse inputs makes it promising for exposing non-crashing, but unexpected, behaviors earlier. Still, without suitable mechanisms to analyze program behaviors, the rich data produced during fuzzing remains inaccessible to reviewers, limiting its practical value in this context. We hypothesize that unexpected variations in program behaviors could signify potential bugs. The impact of code changes can be automatically captured at runtime. Representing program behavior as likely invariants, dynamic properties consistently observed at specific program points, can provide practical signals of behavioral changes. Such signals offer a way to distinguish between intended changes and unexpected behavioral shifts from code changes. We present FuzzSight, a framework that leverages likely invariants from non-crashing fuzzing inputs to highlight behavioral differences across program versions. By surfacing such differences, it provides insights into which code blocks may need closer attention. In our evaluation, FuzzSight flagged 75% of regression bugs and up to 80% of vulnerabilities uncovered by 24-hour fuzzing. It also outperformed SAST in identifying buggy code blocks, achieving ten times higher detection rates with fewer false alarms. In summary, FuzzSight demonstrates the potential and value of leveraging fuzzing and invariant analysis for early-stage code review, bridging static inspection with dynamic behavioral insights.

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

↑