arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.08609cs.SEcs.CRcs.LGcs.PL
收藏

哪种方法更能减少过时和易受攻击的依赖:固定版本还是浮动版本?

Which Is Better For Reducing Outdated and Vulnerable Dependencies: Pinning or Floating?

North Carolina State University(北卡罗来纳州立大学)

Imranur Rahman, Jill Marley, William Enck, Laurie Williams

AI总结:

本研究通过实证分析npm、PyPI和Cargo生态系统中依赖版本约束的使用趋势,利用生存分析比较固定版本与浮动版本对依赖过时和易受攻击风险的影响。

摘要:

开发者通常使用版本约束来指定其项目依赖的可接受版本。固定依赖可以减少破坏性变更的可能性,但需要手动管理过时和易受攻击依赖的替换。另一方面,浮动依赖可以自动获取错误修复和安全修复,但存在破坏性变更的风险。安全从业者主张固定依赖以防止软件供应链攻击,例如恶意包更新。然而,由于固定是最严格的版本约束,它最可能导致依赖过时。尽管如此,不同版本约束类型下依赖变得过时或易受攻击的可能性如何变化尚不清楚。本研究旨在通过大规模实证评估不同版本约束类型下依赖变得过时或易受攻击的可能性,帮助开发者做出明智的依赖版本约束选择。在本研究中,我们首先识别了npm、PyPI和Cargo生态系统中依赖版本约束使用的趋势以及开发者对版本约束类型更改的模式。然后,我们使用生存分析对依赖状态转换进行建模,并估计使用固定版本与其他版本约束类型相比,依赖变得过时或易受攻击的可能性如何变化。我们观察到,在过时和易受攻击的依赖中,最常用的版本约束类型是浮动-次要,固定版本次之。我们还发现,浮动-主要导致过时的可能性最小,而浮动-次要导致易受攻击的可能性最小。

英文摘要:

Developers consistently use version constraints to specify acceptable versions of the dependencies for their project. Pinning dependencies can reduce the likelihood of breaking changes, but comes with a cost of manually managing the replacement of outdated and vulnerable dependencies. On the other hand, floating can be used to automatically get bug fixes and security fixes, but comes with the risk of breaking changes. Security practitioners advocate pinning dependencies to prevent against software supply chain attacks, e.g., malicious package updates. However, since pinning is the tightest version constraint, pinning is the most likely to result in outdated dependencies. Nevertheless, how the likelihood of becoming outdated or vulnerable dependencies changes across version constraint types is unknown. The goal of this study is to aid developers in making an informed dependency version constraint choice by empirically evaluating the likelihood of dependencies becoming outdated or vulnerable across version constraint types at scale. In this study, we first identify the trends in dependency version constraint usage and the patterns of version constraint type changes made by developers in the npm, PyPI, and Cargo ecosystems. We then modeled the dependency state transitions using survival analysis and estimated how the likelihood of becoming outdated or vulnerable changes when using pinning as opposed to the rest of the version constraint types. We observe that among outdated and vulnerable dependencies, the most commonly used version constraint type is floating-minor, with pinning being the next most common. We also find that floating-major is the least likely to result in outdated and floating-minor is the least likely to result in vulnerable dependencies.

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

↑