论文标题

Spellbound:防御软件包打字机

SpellBound: Defending Against Package Typosquatting

论文作者

Taylor, Matthew, Vaidya, Ruturaj K., Davidson, Drew, De Carli, Lorenzo, Rastogi, Vaibhav

论文摘要

基于单个编程语言的软件存储库的软件包经理非常普遍。示例包括NPM(JavaScript)和PYPI(Python)。这些工具鼓励代码重复使用,这使开发人员导入外部软件包变得微不足道。不幸的是,存储库的尺寸和可以发布包装的易于易于使用,可以促进打字的实践:包装的上传,其名称与非常受欢迎的软件包相似,通常是为了捕获一些受欢迎的软件包的安装。 Typosquatting具有严重的负面影响,导致开发人员导入恶意软件包,或者(如我们所显示的)代码克隆,而代码克隆不包括最近的安全更新。为了解决这个问题,我们提出了Sperpbound,这是一种用于识别和向开发人员识别和报告潜在错误进口的工具。 Spellbound基于对NPM和PYPI的深入分析,实现了一种新型的错别字检测技术。我们的技术利用了名称之间的词汇相似性模型,并进一步结合了包装普及的概念。在安装之前,这种方法标志着将安装未知/几乎没有使用的软件包代替具有相似名称的流行包装的情况。我们在NPM和PYPI上评估了Spellbound,结果令人鼓舞:在产生有限的警告(占总包装安装的0.5%)的同时,Spellbound Flags typosquatting Case和低廉的开销(仅占包装安装时间的2.​​5%)。此外,Spellbound使我们能够确认已知的错别字案例,并发现了一个高调的,未知的案例,这导致了NPM Security Team撤出的包裹。

Package managers for software repositories based on a single programming language are very common. Examples include npm (JavaScript), and PyPI (Python). These tools encourage code reuse, making it trivial for developers to import external packages. Unfortunately, repositories' size and the ease with which packages can be published facilitates the practice of typosquatting: the uploading of a package with name similar to that of a highly popular package, typically with the aim of capturing some of the popular package's installs. Typosquatting has serious negative implications, resulting in developers importing malicious packages, or -- as we show -- code clones which do not incorporate recent security updates. In order to tackle this problem, we present SpellBound, a tool for identifying and reporting potentially erroneous imports to developers. SpellBound implements a novel typosquatting detection technique, based on an in-depth analysis of npm and PyPI. Our technique leverages a model of lexical similarity between names, and further incorporates the notion of package popularity. This approach flags cases where unknown/scarcely used packages would be installed in place of popular ones with similar names, before installation occurs. We evaluated SpellBound on both npm and PyPI, with encouraging results: SpellBound flags typosquatting cases while generating limited warnings (0.5% of total package installs), and low overhead (only 2.5% of package install time). Furthermore, SpellBound allowed us to confirm known cases of typosquatting and discover one high-profile, unknown case of typosquatting that resulted in a package takedown by the npm security team.

扫码加入交流群

加入微信交流群

微信交流群二维码

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