The large amount of third-party packages available in fast-moving software ecosystems, such as Node.js/npm, enables attackers to compromise applications by pushing malicious updates to their package dependencies. Studying the npm repository, we observed that many packages in the npm repository that are used in Node.js applications perform only simple computations and do not need access to filesystem or network APIs. This offers the opportunity to enforce least-privilege design per package, protecting applications and package dependencies from malicious updates. We propose a lightweight permission system that protects Node.js applications by enforcing package permissions at runtime. We discuss the design space of solutions and show that our system makes a large number of packages much harder to be exploited, almost for free.
翻译:在快速移动的软件生态系统中,如Node.js/npm, 有大量第三方软件包,使攻击者能够通过恶意更新其软件包依赖性来妥协应用程序。在研究 npm 库时,我们观察到,在Nde.js 应用程序中使用的许多 npm 库中的软件包仅进行简单的计算,不需要访问文件系统或网络API。这为每个软件包实施最不重要的设计、保护应用程序和软件包依赖性不受恶意更新提供了机会。我们提议了一个轻量级许可系统,通过在运行时强制执行软件包许可来保护Nde.js 应用程序。我们讨论了解决方案的设计空间,并表明我们的系统使得大量软件包更难被利用,几乎是免费的。