The increasing popularity of certain programming languages has spurred the creation of ecosystem-specific package repositories and package managers. Such repositories (e.g., NPM, PyPI) serve as public databases that users can query to retrieve packages for various functionalities, whereas package managers automatically handle dependency resolution and package installation on the client side. These mechanisms enhance software modularization and accelerate implementation. However, they have become a target for malicious actors seeking to propagate malware on a large scale. In this work, we show how attackers can leverage capabilities of popular package managers and languages to achieve arbitrary code execution on victim machines, thereby realizing open-source software supply chain attacks. Based on the analysis of 7 ecosystems, we identify 3 install-time and 4 runtime techniques, and we provide recommendations describing how to reduce the risk when consuming third-party dependencies. We will provide proof-of-concepts that demonstrate the identified techniques. Furthermore, we describe evasion strategies employed by attackers to circumvent detection mechanisms.
翻译:随着特定编程语言的日益普及,生态系统专属的包仓库和包管理器应运而生。这类仓库(如NPM、PyPI)作为公共数据库,供用户查询获取实现各种功能的软件包,而包管理器则自动处理客户端侧的依赖解析与包安装。这些机制增强了软件模块化程度并加速了开发进程,却也因此成为恶意行为者大规模传播恶意软件的目标。本研究揭示了攻击者如何利用主流包管理器与编程语言的能力,在受害机器上实现任意代码执行,从而发起开源软件供应链攻击。基于对7个生态系统的分析,我们识别出3种安装时攻击技术与4种运行时攻击技术,并提出了降低第三方依赖使用风险的建议。我们将提供概念验证程序演示所识别的技术,同时阐述攻击者为规避检测机制采用的逃逸策略。