一句话:提出基于知识图谱的依赖解析与依赖树分析,揭示 NPM 漏洞传播路径与演化并提出修复方法。
NPM 生态中第三方依赖丰富,但传递依赖会放大漏洞威胁。已有研究仅考虑直接依赖或基于可达性推断传递依赖,忽略 NPM 实际安装时的依赖解析规则,导致依赖关系解析错误,难以大规模精确分析漏洞传播与演化。本文构建覆盖超 1000 万库版本、6000 万条依赖关系的 DVGraph,并提出 DTResolver,在考虑官方解析规则下静态解析依赖树及传递漏洞传播路径,进而开展生态级实证研究。研究发现大量现象并给出面向不同利益相关者的缓解经验,还实现 DTReme 修复方法,性能优于 npm audit fix。
Third-party libraries with rich functionalities facilitate the fast development of JavaScript software, leading to the explosive growth of the NPM ecosystem. However, it also brings new security threats that vulnerabilities could be introduced through dependencies from third-party libraries. In particular, the threats could be excessively amplified by transitive dependencies. Existing research only considers direct dependencies or reasoning transitive dependencies based on reachability analysis, which neglects the NPM-specific dependency resolution rules as adapted during real installation, resulting in wrongly resolved dependencies. Consequently, further fine-grained analysis, such as precise vulnerability propagation and their evolution over time in dependencies, cannot be carried out precisely at a large scale, as well as deriving ecosystem-wide solutions for vulnerabilities in dependencies. To fill this gap, we propose a knowledge graph-based dependency resolution, which resolves the inner dependency relations of dependencies as trees (i.e., dependency trees), and investigates the security threats from vulnerabilities in dependency trees at a large scale. Specifically, we first construct a complete dependency-vulnerability knowledge graph (DVGraph) that captures the whole NPM ecosystem (over 10 million library versions and 60 million well-resolved dependency relations). Based on it, we propose a novel algorithm (DTResolver) to statically and precisely resolve dependency trees, as well as transitive vulnerability propagation paths, for each package by taking the official dependency resolution rules into account. Based on that, we carry out an ecosystem-wide empirical study on vulnerability propagation and its evolution in dependency trees. Our study unveils lots of useful findings, and we further discuss the lessons learned and solutions for different stakeholders to mitigate the vulnerability impact in NPM based on our findings. For example, we implement a dependency tree based vulnerability remediation method (DTReme) for NPM packages, and receive much better performance than the official tool (npm audit fix).
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2201-03981,
title = {Demystifying the vulnerability propagation and its evolution via dependency trees in the NPM ecosystem},
author = {Chengwei Liu and Sen Chen and Lingling Fan and Bihuan Chen and Yang Liu and Xin Peng},
booktitle = {ICSE},
year = {2022},
doi = {10.1145/3510003.3510142}
}