版本控制系统仓库中的历史篡改:来自实践的证据
Altered Histories in Version Control System Repositories: Evidence from the Trenches
AI总结:
本研究首次大规模调查公共Git仓库中的历史篡改,分析1.11亿个仓库发现122万个存在篡改,并推出GitHistorian工具以自动检测和描述此类篡改。
摘要:
版本控制系统(VCS),如Git,允许开发者在本地重写已记录的历史,例如重新排序和抑制提交或其中的特定数据。这些篡改有合法的使用场景,但当在具有下游用户的分支上执行时就会变得有问题:它们破坏推送/拉取工作流,挑战仓库的完整性和可复现性,并为供应链攻击者创造机会,将恶意更改偷偷引入其中。我们对公共代码仓库中的Git历史篡改进行了首次大规模调查。我们分析了由Software Heritage存档的1.11亿个仓库,该存档即使在篡改后也能保留VCS历史。我们在122万个仓库中发现了历史篡改,总计有870万个重写的历史。我们按发生位置(哪些仓库、哪些分支)和更改内容(文件或提交元数据)对更改进行分类。通过两个有针对性的案例研究,我们表明被篡改的历史反复地追溯性地更改许可证,或被用于移除错误提交的“秘密”(例如私钥)。由于这些行为分别对应于项目管理或安全管理方面的不良实践,软件接收者可能希望避免这些行为,我们引入了GitHistorian,一个自动化工具,开发者可以使用它来发现和描述公共Git仓库中的历史篡改。
英文摘要:
Version Control Systems (VCS) like Git allow developers to locally rewrite recorded history, e.g., to reorder and suppress commits or specific data in them. These alterations have legitimate use cases, but become problematic when performed on public branches that have downstream users: they break push/pull workflows, challenge the integrity and reproducibility of repositories, and create opportunities for supply chain attackers to sneak into them nefarious changes. We conduct the first large-scale investigation of Git history alterations in public code repositories. We analyze 111 M (millions) repositories archived by Software Heritage, which preserves VCS histories even across alterations. We find history alterations in 1.22 M repositories, for a total of 8.7 M rewritten histories. We categorize changes by where they happen (which repositories, which branches) and what is changed in them (files or commit metadata). Conducting two targeted case studies we show that altered histories recurrently change licenses retroactively, or are used to remove ''secrets'' (e.g., private keys) committed by mistake. As these behaviors correspond to bad practices-in terms of project governance or security management, respectively-that software recipients might want to avoid, we introduce GitHistorian, an automated tool, that developers can use to spot and describe history alterations in public Git repositories.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。