How Do Developers Follow Security-Relevant Best Practices When Using NPM Packages?

Md Mahir Asef Kabir, Ying Wang, D. Yao, Na Meng
{"title":"How Do Developers Follow Security-Relevant Best Practices When Using NPM Packages?","authors":"Md Mahir Asef Kabir, Ying Wang, D. Yao, Na Meng","doi":"10.1109/SecDev53368.2022.00027","DOIUrl":null,"url":null,"abstract":"Node.js has become popular among developers, partially because of its large software ecosystem of NPM (Node Package Manager) packages. When building JavaScript (JS) applications on top of NPM packages, developers can reuse the provided functionalities to improve programmer productivity. However, many NPM packages have been recently found vulner-able or malicious. Such packages can introduce vulnerabilities into their client JS applications, and realize software supply chain attacks. To reduce the impact of potentially malicious NPM packages in Node.js software ecosystem, experts suggested best practices to developers when they maintain package depen-dencies. These best practices include using specific commands and/or tools to (a) conduct security audit for dependencies and remove vulnerable dependencies, (b) remove unused and duplicated dependencies, and (c) fixate the version information of library/package dependencies. We were curious how developers followed and will follow those best practices. For this paper, we did a large-scale empirical study on 841 popularly used open-source JS applications. By analyzing their configuration files (e.g., package.json and package-lock.json), we revealed that only 32% of the applications lock the version numbers of package dependencies. The commands/tools reported (i) vulnerable, (ii) unused, and (iii) duplicated dependencies separately in 55 %, 90 %, and 83 % of applications, which fact implies that developers often ignored the best practices we examined. We did a user study with developers to acquire their opinions on the suggested best practices and got interesting feedback. Our research will enlighten future research on the management of NPM package dependencies.","PeriodicalId":407946,"journal":{"name":"2022 IEEE Secure Development Conference (SecDev)","volume":"7 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2022 IEEE Secure Development Conference (SecDev)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SecDev53368.2022.00027","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

Abstract

Node.js has become popular among developers, partially because of its large software ecosystem of NPM (Node Package Manager) packages. When building JavaScript (JS) applications on top of NPM packages, developers can reuse the provided functionalities to improve programmer productivity. However, many NPM packages have been recently found vulner-able or malicious. Such packages can introduce vulnerabilities into their client JS applications, and realize software supply chain attacks. To reduce the impact of potentially malicious NPM packages in Node.js software ecosystem, experts suggested best practices to developers when they maintain package depen-dencies. These best practices include using specific commands and/or tools to (a) conduct security audit for dependencies and remove vulnerable dependencies, (b) remove unused and duplicated dependencies, and (c) fixate the version information of library/package dependencies. We were curious how developers followed and will follow those best practices. For this paper, we did a large-scale empirical study on 841 popularly used open-source JS applications. By analyzing their configuration files (e.g., package.json and package-lock.json), we revealed that only 32% of the applications lock the version numbers of package dependencies. The commands/tools reported (i) vulnerable, (ii) unused, and (iii) duplicated dependencies separately in 55 %, 90 %, and 83 % of applications, which fact implies that developers often ignored the best practices we examined. We did a user study with developers to acquire their opinions on the suggested best practices and got interesting feedback. Our research will enlighten future research on the management of NPM package dependencies.
开发人员在使用NPM包时如何遵循与安全相关的最佳实践?
Node.js在开发人员中很受欢迎,部分原因是其庞大的NPM (Node Package Manager)软件包生态系统。当在NPM包之上构建JavaScript (JS)应用程序时,开发人员可以重用所提供的功能来提高程序员的工作效率。然而,最近发现许多NPM包存在漏洞或恶意。这类包可以在其客户端JS应用中引入漏洞,实现软件供应链攻击。为了减少潜在恶意NPM包对Node.js软件生态系统的影响,专家建议开发人员在维护包依赖时采用最佳实践。这些最佳实践包括使用特定的命令和/或工具来(a)对依赖项进行安全审计并删除易受攻击的依赖项,(b)删除未使用和重复的依赖项,以及(c)固定库/包依赖项的版本信息。我们很好奇开发人员是如何遵循并将遵循这些最佳实践的。在本文中,我们对841个常用的开源JS应用程序进行了大规模的实证研究。通过分析它们的配置文件(例如,package。Json和package-lock. Json),我们发现只有32%的应用程序锁定包依赖项的版本号。命令/工具分别在55%、90%和83%的应用程序中报告了(i)易受攻击、(ii)未使用和(iii)重复的依赖项,这意味着开发人员经常忽略我们所研究的最佳实践。我们对开发人员进行了用户研究,以获取他们对建议的最佳实践的意见,并获得了有趣的反馈。我们的研究将对未来对NPM包依赖管理的研究有所启发。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信