The Hitchhiker's Guide to Malicious Third-Party Dependencies (2307.09087v3)
Abstract: 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.
- [n. d.]. Build Scripts - The Cargo Book. https://doc.rust-lang.org/cargo/reference/build-scripts.html. [Accessed 30-Jun-2023].
- [n. d.]. Chapter 12. Execution — docs.oracle.com. https://docs.oracle.com/javase/specs/jls/se20/html/jls-12.html [Accessed 28-08-2023].
- [n. d.]. Chapter 8. Classes — docs.oracle.com. https://docs.oracle.com/javase/specs/jls/se20/html/jls-8.html. [Accessed 28-08-2023].
- [n. d.]. Command-line interface / Commands - Composer – getcomposer.org. https://getcomposer.org/doc/03-cli.md#install-i. [Accessed 30-Jun-2023].
- [n. d.]. Effective Go - The Go Programming Language. https://go.dev/doc/effective_go. [Accessed 30-Jun-2023].
- [n. d.]. Gems with Extensions. https://guides.rubygems.org/gems-with-extensions. [Accessed 30-Jun-2023].
- [n. d.]. MITRE ATT&CK; – attack.mitre.org. https://attack.mitre.org/. [Accessed 30-Jun-2023].
- [n. d.]. Modules: Packages. https://nodejs.org/api/packages.html. [Accessed 30-Jun-2023].
- [n. d.]. npm-install - npm Docs. https://docs.npmjs.com/cli/v9/commands/npm-install. [Accessed 30-Jun-2023].
- [n. d.]. package.json - npm Docs. https://docs.npmjs.com/cli/v8/configuring-npm/package-json#scripts. [Accessed 30-Jun-2023].
- [n. d.]. pip install - pip documentation v23.1.2 – pip.pypa.io. https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-only-binary. [Accessed 30-Jun-2023].
- [n. d.]. Scripts - Composer – getcomposer.org. https://getcomposer.org/doc/articles/scripts.md#scripts. [Accessed 30-Jun-2023].
- [n. d.]. The import system. https://docs.python.org/3/reference/import.html. [Accessed 30-Jun-2023].
- 2022. Stack Overflow Developer Survey 2022 – survey.stackoverflow.co. https://survey.stackoverflow.co/2022/#technology-most-loved-dreaded-and-wanted. [Accessed 30-Jun-2023].
- 2023. PyPI new user and new project registrations temporarily suspended. https://status.python.org/incidents/qy2t9mjjcc7g?u=l1b53kd6n2rs. [Accessed 30-Jun-2023].
- I know what you imported last summer: A study of security threats in thepython ecosystem. arXiv preprint arXiv:2102.06301 (2021).
- Nicholas Boucher and Ross Anderson. 2023. Trojan Source: Invisible Vulnerabilities. (2023).
- Check Point Research. 2022. Check Point CloudGuard Spectral exposes new obfuscation techniques for malicious packages on PyPI. https://research.checkpoint.com/2022/check-point-cloudguard-spectral-exposes-new-obfuscation-techniques-for-malicious-packages-on-pypi/. [Accessed 30-Jun-2023].
- C.S. Collberg and C. Thomborson. 2002. Watermarking, tamper-proofing, and obfuscation - tools for software protection. IEEE Transactions on Software Engineering 28, 8 (2002), 735–746. https://doi.org/10.1109/TSE.2002.1027797
- A taxonomy of obfuscating transformations. Technical Report. Department of Computer Science, The University of Auckland, New Zealand.
- Towards Measuring Supply Chain Attacks on Package Managers for Interpreted Languages. In Proceedings of the Network and Distributed System Security Symposium (NDSS).
- ENISA. 2022. ENISA Threat Landscape 2022. https://www.enisa.europa.eu/publications/enisa-threat-landscape-2022. [Accessed 30-Jun-2023].
- Geek. 2010. Tricky use of static initializer in Java - Override println — geekexplains.blogspot.com. http://geekexplains.blogspot.com/2009/05/tricky-use-of-static-initializer-in.html. [Accessed 28-08-2023].
- Paulo Gomes. 2019. Golang: stop trusting your dependencies! https://itnext.io/golang-stop-trusting-your-dependencies-a4c916533b04. [Accessed 30-Jun-2023].
- Michael Henriksen. 2021. Finding Evil Go Packages. https://michenriksen.com/blog/finding-evil-go-packages/. [Accessed 11-Jul-2023].
- The White House. 2021. Executive Order on Improving the Nation’s Cybersecurity. https://www.whitehouse.gov/briefing-room/presidential-actions/2021/05/12/executive-order-on-improving-the-nations-cybersecurity. [Accessed 30-Jun-2023].
- Thomas Hunter II. [n. d.]. Compromised npm Package: event-stream — medium.com. https://medium.com/intrinsic-blog/compromised-npm-package-event-stream-d47d08605502. [Accessed 30-08-2023].
- SoK: Taxonomy of Attacks on Open-Source Software Supply Chains. IEEE Symposium on Security and Privacy (SP), 1509–1526.
- Risk Explorer for Software Supply Chains: Understanding the Attack Surface of Open-Source Based Software Development. In Proceedings of the ACM Workshop on Software Supply Chain Offensive Research and Ecosystem Defenses (SCORED). 35–36.
- Towards the Detection of Malicious Java Packages. In Proceedings of the 2022 ACM Workshop on Software Supply Chain Offensive Research and Ecosystem Defenses (SCORED). 63–72.
- Census II of Free and Open Source Software—Application Libraries. Linux Foundation, Harvard Laboratory for Innovation Science (LISH) and Open Source Security Foundation (OpenSSF) 80 (2022).
- Marc Ohm. 2020. Backstabber’s Knife Collection. https://dasfreak.github.io/Backstabbers-Knife-Collection. [Accessed 30-Jun-2023].
- On the Feasibility of Supervised Machine Learning for the Detection of Malicious Software Packages. In Proceedings of the 17th International Conference on Availability, Reliability and Security. 1–10.
- Backstabber’s Knife Collection: A Review of Open Source Software Supply Chain Attacks. In International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment (DIMVA). 23–43.
- You Can Run But You Can’t Hide: Runtime Protection Against Malicious Package Updates For Node. js. arXiv preprint arXiv:2305.19760 (2023).
- SoK: Analysis of Software Supply Chain Security by Establishing Secure Design Properties. In Proceedings of the ACM Workshop on Software Supply Chain Offensive Research and Ecosystem Defenses (SCORED). 15–24.
- Brian Pfretzschner and Lotfi ben Othmane. 2017. Identification of Dependency-Based Attacks on Node.Js. In Proceedings of the 12th International Conference on Availability, Reliability and Security (ARES). 1–6.
- Protecting Software through Obfuscation: Can It Keep Pace with Progress in Code Analysis? ACM Comput. Surv. 49, 1, Article 4 (apr 2016), 37 pages. https://doi.org/10.1145/2886012
- A study & review on code obfuscation. In 2016 World Conference on Futuristic Trends in Research and Innovation for Social Welfare (Startup Conclave). 1–6. https://doi.org/10.1109/STARTUP.2016.7583913
- Adriana Sejfia and Max Schäfer. 2022. Practical Automated Detection of Malicious npm Packages. In Proceedings of the 44th International Conference on Software Engineering (ICSE). 1681–1692.
- Michael Sikorski and Andrew Honig. 2012. Practical Malware Analysis: The Hands-On Guide to Dissecting Malicious Software (1st ed.). No Starch Press, USA.
- Sonatype. 2022. 8th Annual State of the Software Supply Chain Report. https://www.sonatype.com/state-of-the-software-supply-chain. [Accessed 30-Jun-2023].
- Phylum Research Team. 2022. Phylum Discovers Dozens More PyPI Packages Attempting to Deliver W4SP Stealer in Ongoing Supply-Chain Attack. https://blog.phylum.io/phylum-discovers-dozens-more-pypi-packages-attempting-to-deliver-w4sp-stealer-in-ongoing-supply-chain-attack/. [Accessed 30-Jun-2023].
- Sonatype Security Research Team. [n. d.]. Sonatype Stops Software Supply Chain Attack Aimed at the Java Developer Community — blog.sonatype.com. https://blog.sonatype.com/malware-removed-from-maven-central. [Accessed 22-08-2023].
- The PyTorch Team. 2023. Compromised PyTorch-nightly dependency chain between December 25th and December 30th, 2022. https://pytorch.org/blog/compromised-nightly-dependency. [Accessed 30-Jun-2023].
- Bill Toulas. 2023. Malicious Lolip0p PyPi packages install info-stealing malware. https://www.bleepingcomputer.com/news/security/malicious-lolip0p-pypi-packages-install-info-stealing-malware. [Accessed 30-Jun-2023].
- SoK: Deep Packer Inspection: A Longitudinal Study of the Complexity of Run-Time Packers. In 2015 IEEE Symposium on Security and Privacy. 659–673. https://doi.org/10.1109/SP.2015.46
- Filippo Valsorda. 2022. How Go Mitigates Supply Chain Attacks. https://go.dev/blog/supply-chain. [Accessed 30-Jun-2023].
- Bouke van der Bijl. 2015. Monkey Patching in Go. https://bou.ke/blog/monkey-patching-in-go/. [Accessed 30-Jun-2023].
- Steven Vaughan-Nichols. 2022. Linus Torvalds: Rust will go into Linux 6.1 – zdnet.com. https://www.zdnet.com/article/linus-torvalds-rust-will-go-into-linux-6-1. [Accessed 30-Jun-2023].
- Jeff Williams. 2009. Enterprise Java Rootkits: ”Hardly anyone watches the developers”. In BlackHat USA.
- Wolf at the Door: Preventing Install-Time Attacks in Npm with Latch. In Proceedings of the 2022 ACM on Asia Conference on Computer and Communications Security (ASIACCS). 1139–1153.
- On Secure and Usable Program Obfuscation: A Survey. arXiv:1710.01139 [cs.CR]
- Ilsun You and Kangbin Yim. 2010. Malware Obfuscation Techniques: A Brief Survey. In 2010 International Conference on Broadband, Wireless Computing, Communication and Applications. 297–300. https://doi.org/10.1109/BWCCA.2010.85
- What are weak links in the npm supply chain?. In Proceedings of the 44th International Conference on Software Engineering: Software Engineering in Practice (ICSE). 331–340.
- Karlo Zanki. 2022. IconBurst NPM software supply chain attack grabs data from apps and websites. https://www.reversinglabs.com/blog/iconburst-npm-software-supply-chain-attack-grabs-data-from-apps-websites. [Accessed 30-Jun-2023].
- Small World with High Risks: A Study of Security Threats in the npm Ecosystem. In 28th USENIX Security Symposium (USENIX Security). 995–1010.
- Piergiorgio Ladisa (5 papers)
- Merve Sahin (1 paper)
- Serena Elisa Ponta (11 papers)
- Marco Rosa (5 papers)
- Matias Martinez (51 papers)
- Olivier Barais (16 papers)