一句话:提出 UNWRAPPER,在 npm 全生态中快速检测隐藏的“套壳克隆”包,并揭示其携带未修复漏洞的安全风险。
本文关注 npm 包生态中未被充分研究的 shrinkwrapped clones(套壳克隆):某包复制或近乎复制另一包的代码,却不注明来源。这类克隆会分流原作者关注,或隐藏复制含漏洞代码,逃避审计。作者提出 UNWRAPPER,用基于目录树相似度的包差异度量,并加入预过滤快速排除不可能克隆,从而在全 npm 生态中匹配目标包。原型可在 72.85 秒内将给定包与 1,716,061 个包、20,190,452 个版本比较,适合在线部署。实际分析发现最多 6,292 个此前未知克隆,其中最多 207 个携带原包已修复但克隆未修复的漏洞,且标准 npm audit 无法发现。
This work presents findings and mitigations on an under-studied issue, which we term shrinkwrapped clones, that is endemic to the npm software package ecosystem. A shrink-wrapped clone is a package which duplicates, or near-duplicates, the code of another package without any indication or refer-ence to the original package. This phenomenon represents a challenge to the hygiene of package ecosystems, as a clone package may siphon interest from the package being cloned, or create hidden duplicates of vulnerable, insecure code which can fly under the radar of audit processes. Motivated by these considerations, we propose UNWRAP-PER, a mechanism to programmatically detect shrinkwrapped clones and match them to their source package. UNWRAP-PER uses a package difference metric based on directory tree similarity, augmented with a prefilter which quickly weeds out packages unlikely to be clones of a target. Overall, our prototype can compare a given package within the entire npm ecosystem (1,716,061 packages with 20,190,452 differ-ent versions) in 72.85 seconds, and it is thus practical for live deployment. Using our tool, we performed an analysis of a subset of npm packages, which resulted in finding up to 6,292 previously unknown shrinkwrapped clones, of which up to 207 carried vulnerabilities from the original package that had already been fixed in the original package. None of such vulnerabilities were discoverable via the standard npm audit process.