paperbot · PL 论文追踪

全部论文 待读 收藏

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

哪种方式更能减少过时和易受攻击的依赖:固定版本还是浮动版本?
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 2/10 · 该论文是软件工程实证研究,考察 npm/PyPI/Cargo 生态中固定版本约束(pinning)与浮动约束(floating)对依赖过时/易受攻击的影响,属于依赖管理与供应链安全方向;它既不涉及静态分析、形式化验证,也不涉及 LLM/Agent 与程序分析的交叉,其中的“floating”指版本约束而非浮点程序分析,与用户画像的各条主线基本无交集。仅在“大规模实证/生存分析”这一方法层面与用户偏好工程落地略有微弱共鸣。引用 1 inbox
Imranur Rahman, Jill Marley, William Enck, Laurie Williams
crossref: 2026-09-12

AI 速览

一句话:用生存分析在 npm、PyPI、Cargo 生态实证比较固定与浮动版本约束对依赖过时及易受攻击可能性的影响。

依赖版本约束的选择在固定(pinning)与浮动(floating)之间存在权衡:固定可降低破坏性变更与供应链攻击风险,却需人工管理替换,易导致依赖过时;浮动可自动获取缺陷与安全修复,却可能引入不兼容变更。论文针对 npm、PyPI 与 Cargo 三个生态,首先刻画开发者使用版本约束的趋势以及约束类型间迁移的模式,随后用生存分析对依赖状态转移建模,估计固定相较其他约束类型时依赖变为过时或易受攻击的可能性。结果显示,在过时与易受攻击的依赖中,floating-minor 最常见,pinning 次之;floating-major 最不易导致过时,floating-minor 最不易导致脆弱。作者据此建议开发者采用任意浮动约束并配合 lockfile,以平衡固定与浮动的利弊。

问题
开发者难以判断固定版本还是浮动版本更能减少依赖过时与被攻击的风险,且不同版本约束类型对依赖过时或易受攻击可能性的影响此前缺乏大规模实证结论。
方法
在 npm、PyPI 和 Cargo 生态中识别版本约束使用趋势与约束类型变更模式,并用生存分析建模依赖状态转移,估计固定相较其他约束类型导致过时或易受攻击的可能性变化。
评估
基于三大生态的大规模依赖数据比较各版本约束类型:floating-minor 在过时与易受攻击依赖中最常见,floating-major 最不易过时,floating-minor 最不易脆弱。
原文摘要(Abstract)

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. Based on our findings, we recommend that developers use any kind of floating constraint with lockfiles to balance the tradeoffs of pinning and floating.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot9498,
  title = {Which Is Better For Reducing Outdated and Vulnerable Dependencies: Pinning or Floatingƒ},
  author = {Imranur Rahman and Jill Marley and William Enck and Laurie Williams},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00229}
}