论文标题

并非所有的依赖性都是平等的:关于NPM生产依赖性的实证研究

Not All Dependencies are Equal: An Empirical Study on Production Dependencies in NPM

论文作者

Latendresse, Jasmine, Mujahid, Suhaib, Costa, Diego Elias, Shihab, Emad

论文摘要

现代软件系统通常是通过利用其他人以库和包裹形式编写的代码来构建的,以加速其开发。尽管使用第三方软件包有很多好处,但软件项目通常会依赖大量的软件包。因此,开发人员面临着艰难的挑战,即通过保持最新和摆脱安全漏洞来维持其项目依赖性。但是,在生产中使用项目依赖性多久可能对项目的安全构成威胁? 我们使用节点软件包管理器(NPM)对100个JavaScript项目进行了实证研究,以量化项目依赖性被释放到生产和分析其特征及其对安全性的影响的频率。我们的结果表明,不到1%的安装依赖项被释放到生产中。我们的分析表明,软件包的功能不足以确定是否将其发布到生产中。实际上,在生产中不使用配置为运行时依赖关系的安装依赖项中有59%,而被配置为开发依赖的依赖项中有28.2%用于生产中,揭露了两个依赖关系管理的共同假设。调查结果还表明,大多数安全警报的目标依赖性未在生产中使用,因此极不可能冒着软件安全的风险。我们的研究揭示了依赖管理的更复杂的一面:并非所有的依赖性都是平等的。生产中使用的依赖项对安全暴露更敏感,应优先考虑。但是,当前工具在识别生产依赖性方面缺乏适当的支持。

Modern software systems are often built by leveraging code written by others in the form of libraries and packages to accelerate their development. While there are many benefits to using third-party packages, software projects often become dependent on a large number of software packages. Consequently, developers are faced with the difficult challenge of maintaining their project dependencies by keeping them up-to-date and free of security vulnerabilities. However, how often are project dependencies used in production where they could pose a threat to their project's security? We conduct an empirical study on 100 JavaScript projects using the Node Package Manager (npm) to quantify how often project dependencies are released to production and analyze their characteristics and their impact on security. Our results indicate that less than 1% of the installed dependencies are released to production. Our analysis reveals that the functionality of a package is not enough to determine if it will be released to production or not. In fact, 59% of the installed dependencies configured as runtime dependencies are not used in production, and 28.2% of the dependencies configured as development dependencies are used in production, debunking two common assumptions of dependency management. Findings also indicate that most security alerts target dependencies not used in production, making them highly unlikely to be a risk for the security of the software. Our study unveils a more complex side of dependency management: not all dependencies are equal. Dependencies used in production are more sensitive to security exposure and should be prioritized. However, current tools lack the appropriate support in identifying production dependencies.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源