论文标题

通过MAX-SMT的灵活和最佳依赖管理

Flexible and Optimal Dependency Management via Max-SMT

论文作者

Pinckney, Donald, Cassano, Federico, Guha, Arjun, Bell, Jon, Culpo, Massimiliano, Gamblin, Todd

论文摘要

NPM等包装管理人员已成为软件开发至关重要的。 NPM存储库托管超过200万个包装,每周下载超过430亿。不幸的是,NPM依赖求解器有几个缺点。 1)NPM是贪婪的,通常无法安装依赖项的最新版本; 2)NPM的算法导致重复的依赖关系和肿的代码,这对于需要最小化代码大小的Web应用程序尤其不利; 3)NPM的脆弱性修复算法也很贪婪,甚至可以引入新的漏洞; 4)NPM复制依赖项的能力可以打破状态框架,并且需要大量注意力才能解决。尽管现有的工具试图解决这些问题,但它们要么脆弱,要么依赖于依赖树的事后变化,要不能保证最佳性或不合理。 我们提出PACSOLVE,这是一个统一的框架和依赖解决方案的实现,可以实现可自定义的约束和优化目标。我们使用PACSOLVE来构建MaxNPM,这是NPM的完整,倒入式替换,这使开发人员在安装依赖项时可以结合多个目标。我们使用NPM生态系统中的大量包装来评估MAXNPM,并表明它可以:1)在33%的情况下,比NPM的审计工具减少依赖关系中的脆弱性更多; 2)在14%的病例中选择比NPM更新的依赖性; 3)在21%的情况下,选择比NPM少的依赖性。我们所有的代码和数据都是打开并可用的。

Package managers such as NPM have become essential for software development. The NPM repository hosts over 2 million packages and serves over 43 billion downloads every week. Unfortunately, the NPM dependency solver has several shortcomings. 1) NPM is greedy and often fails to install the newest versions of dependencies; 2) NPM's algorithm leads to duplicated dependencies and bloated code, which is particularly bad for web applications that need to minimize code size; 3) NPM's vulnerability fixing algorithm is also greedy, and can even introduce new vulnerabilities; and 4) NPM's ability to duplicate dependencies can break stateful frameworks and requires a lot of care to workaround. Although existing tools try to address these problems they are either brittle, rely on post hoc changes to the dependency tree, do not guarantee optimality, or are not composable. We present PacSolve, a unifying framework and implementation for dependency solving which allows for customizable constraints and optimization goals. We use PacSolve to build MaxNPM, a complete, drop-in replacement for NPM, which empowers developers to combine multiple objectives when installing dependencies. We evaluate MaxNPM with a large sample of packages from the NPM ecosystem and show that it can: 1) reduce more vulnerabilities in dependencies than NPM's auditing tool in 33% of cases; 2) chooses newer dependencies than NPM in 14% of cases; and 3) chooses fewer dependencies than NPM in 21% of cases. All our code and data is open and available.

扫码加入交流群

加入微信交流群

微信交流群二维码

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