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种运行时技术,并提出降低第三方依赖使用风险的建议。我们将提供概念验证以演示所识别技术,并进一步描述攻击者为规避检测机制所采用的逃避策略。