arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2206.09422cs.SE
收藏

您的依赖项代码是否经过审查?:在依赖项更新中度量代码审查覆盖率

Are your dependencies code reviewed?: Measuring code review coverage in dependency updates

Nasif Imtiaz, Laurie Williams

摘要:

由于现代软件广泛使用免费的开源软件包作为依赖项,开发人员必须通过频繁的更新定期引入新的第三方代码。然而,如果不对每个传入的更改进行适当的审查,易受攻击的代码和恶意代码就可以通过这些依赖项潜入代码库。本研究的目标是帮助开发人员通过测量更新中的代码更改是否通过了代码审查过程,安全地接受依赖更新。我们实现了Depdive,这是一个更新审计工具,用于Crates.io,npm,PyPI和RubyGems注册表中的包。Depdive first(i)标识更新中无法追溯到软件包的源存储库的文件和代码更改,即,\textit{phantom artifacts} ;然后(i i)测量更新中的改变的哪一部分(不包括幻影工件)已经通过代码审查过程,即,\textit{code review coverage}。使用Depdive,我们提出了一个实证研究,在最近十次更新的最下载的1000个软件包在四个注册表。我们通过维护者协议调查进一步评估了我们的结果。我们发现更新通常只进行部分代码审查(52.5%的时间)。此外,在我们的数据集中,只有9.0%的软件包的所有更新都经过了完全的代码审查,这表明即使是最常用的软件包也会在软件供应链中引入未经审查的代码。我们还观察到,更新要么倾向于具有高\textit{CRC},要么倾向于具有低\textit{CRC},这表明在谱的另一端的包可能需要一组单独的处理。

英文摘要:

As modern software extensively uses free open source packages as dependencies, developers have to regularly pull in new third-party code through frequent updates. However, without a proper review of every incoming change, vulnerable and malicious code can sneak into the codebase through these dependencies. The goal of this study is to aid developers in securely accepting dependency updates by measuring if the code changes in an update have passed through a code review process. We implement Depdive, an update audit tool for packages in Crates.io, npm, PyPI, and RubyGems registry. Depdive first (i) identifies the files and the code changes in an update that cannot be traced back to the package's source repository, i.e., \textit{phantom artifacts}; and then (ii) measures what portion of changes in the update, excluding the phantom artifacts, has passed through a code review process, i.e., \textit{code review coverage}. Using Depdive, we present an empirical study across the latest ten updates of the most downloaded 1000 packages in each of the four registries. We further evaluated our results through a maintainer agreement survey. We find the updates are typically only partially code-reviewed (52.5\% of the time). Further, only 9.0\% of the packages had all their updates in our data set fully code-reviewed, indicating that even the most used packages can introduce non-reviewed code in the software supply chain. We also observe that updates either tend to have high \textit{CRC} or low \textit{CRC}, suggesting that packages at the opposite end of the spectrum may require a separate set of treatments.

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

↑