Lune

ASE2023顶会

An Empirical Study of Malicious Code In PyPI Ecosystem

Wenbo Guo, Zhengzi Xu, Chengwei Liu, Cheng Huang, Yong Fang, Yang Liu

摘要

PyPI provides a convenient and accessible package management platform to developers, enabling them to quickly implement specific functions and improve work efficiency. However, the rapid development of the PyPI ecosystem has led to a severe problem of malicious package propagation. Malicious developers disguise malicious packages as normal, posing a significant security risk to end-users. To this end, we conducted an empirical study to understand the characteristics and current state of the malicious code lifecycle in the PyPI ecosystem. We first built an automated data collection framework and collated a multi-source malicious code dataset containing 4,669 malicious package files. We preliminarily classified these malicious code into five categories based on malicious behaviour characteristics. Our research found that over 50 % of malicious code exhibits multiple malicious behaviours, with information stealing and command execution being particularly prevalent. In addition, we observed several novel attack vectors and anti-detection techniques. Our analysis revealed that 74.81 % of all malicious packages successfully entered end-user projects through source code installation, thereby increasing security risks. A real-world investigation showed that many reported malicious packages persist in PyPI mirror servers globally, with over 72 % remaining for an extended period after being discovered. Finally, we sketched a portrait of the malicious code lifecycle in the PyPI ecosystem, effectively reflecting the characteristics of malicious code at different stages. We also present some suggested mitigations to improve the security of the Python open-source ecosystem.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 19 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Investigating Package Related Security Threats in Software Registries 引用了 Towards Measuring Supply Chain Attacks on Package Managers for Interpreted Languages
  • SpiderScan: Practical Detection of Malicious NPM Packages Based on Graph-Based Behavior Modeling and Matching 引用了 Investigating Package Related Security Threats in Software Registries
  • SpiderScan: Practical Detection of Malicious NPM Packages Based on Graph-Based Behavior Modeling and Matching 引用了 LastPyMile: identifying the discrepancy between sources and packages
  • SpiderScan: Practical Detection of Malicious NPM Packages Based on Graph-Based Behavior Modeling and Matching 引用了 Towards Measuring Supply Chain Attacks on Package Managers for Interpreted Languages
  • LastPyMile: identifying the discrepancy between sources and packages 引用了 Towards Measuring Supply Chain Attacks on Package Managers for Interpreted Languages
  • "Do Not Mention This to the User": Detecting and Understanding Malicious Agent Skills in the Wild 引用了 Towards Measuring Supply Chain Attacks on Package Managers for Interpreted Languages
  • 1+1>2: Integrating Deep Code Behaviors with Metadata Features for Malicious PyPI Package Detection 引用了 Investigating Package Related Security Threats in Software Registries
  • 1+1>2: Integrating Deep Code Behaviors with Metadata Features for Malicious PyPI Package Detection 引用了 LastPyMile: identifying the discrepancy between sources and packages
  • Leveraging Large Language Models to Detect NPM Malicious Packages 引用了 LastPyMile: identifying the discrepancy between sources and packages
  • Leveraging Large Language Models to Detect NPM Malicious Packages 引用了 Towards Measuring Supply Chain Attacks on Package Managers for Interpreted Languages
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper19

  1. "Do Not Mention This to the User": Detecting and Understanding Malicious Agent Skills in the WildYi Liu, Zhihao Chen, Yanjun Zhang, Gelei Deng 等USENIX Security 2026 · 46 次引用
  2. Leveraging Large Language Models to Detect NPM Malicious PackagesNusrat Zahan, Philipp Burckhardt, Mikola Lysenko, Feross Aboukhadijeh 等ICSE 2025 · 8 次引用
  3. SpiderScan: Practical Detection of Malicious NPM Packages Based on Graph-Based Behavior Modeling and MatchingYiheng Huang, Ruisi Wang, Wen Zheng, Zhuotong Zhou 等ASE 2024 · 4 次引用
  4. 1+1>2: Integrating Deep Code Behaviors with Metadata Features for Malicious PyPI Package DetectionXiaobing Sun, Xingan Gao, Sicong Cao, Lili Bo 等ASE 2024 · 3 次引用
  5. An Empirical Study of Observability Limits in Advanced Software Supply Chain AttacksZhuoran Tan, Wenbo Guo, Jiewen Luo, Taylor Brierley 等CCS 2026 · 3 次引用

它引用的 Paper6

  1. Stack Overflow Considered Harmful? The Impact of Copy&Paste on Android Application SecurityFelix Fischer, Konstantin Böttinger, Huang Xiao, Christian Stransky 等S&P 2017 · 293 次引用
  2. LastPyMile: identifying the discrepancy between sources and packagesDuc-Ly Vu, Fabio Massacci, Ivan Pashchenko, Henrik Plate 等FSE 2021 · 53 次引用
  3. Characterizing Transaction-Reverting Statements in Ethereum Smart ContractsLu Liu, Lili Wei, Wuqi Zhang, Ming Wen 等ASE 2021 · 25 次引用
  4. Investigating Package Related Security Threats in Software RegistriesYacong Gu, Lingyun Ying, Yingyuan Pu, Xiao Hu 等S&P 2023
  5. Towards Measuring Supply Chain Attacks on Package Managers for Interpreted LanguagesRuian Duan, Omar Alrawi, Ranjita Pai Kasturi, Ryan Elder 等NDSS 2021

相关 Paper

  1. Uncovering Similar but Different Packages in PyPI and Potential Security ThreatsSunha Park, Soojin Han, Seunghoon WooFSE 2026
  2. A Needle is an Outlier in a Haystack: Hunting Malicious PyPI Packages with Code ClusteringWentao Liang, Xiang Ling, Jingzheng Wu, Tianyue Luo 等ASE 2023 · 15 次引用
  3. Bad Snakes: Understanding and Improving Python Package Index Malware ScanningDuc-Ly Vu, Zachary Newman, John Speed MeyersICSE 2023 · 18 次引用
  4. Cutting the Gordian Knot: Detecting Malicious PyPI Packages via a Knowledge-Mining FrameworkWenbo Guo, Chengwei Liu, Ming Kang, Yiran Zhang 等USENIX Security 2026 · 1 次引用
  5. Insight: Exploring Cross-Ecosystem Vulnerability ImpactsMeiqiu Xu, Ying Wang, Shing-Chi Cheung, Hai Yu 等ASE 2022 · 12 次引用
黄昏的海面,两侧是细线勾勒的悬崖