Hackers of India

Unearthing Malicious And Other “Risky” Open-Source Packages Using Packj

 Devdutt Patnaik  , Ashish Bijlani 

2022/09/07


Presentation Material

Abstract

From a benign left-pad beginning to recent protestware, software supply chain attacks on open-source package managers such as NPM and PyPI have grown manifold. Bad actors today leverage highly sophisticated techniques such as typo-squatting, repo-jacking, and social engineering to “supply” malicious code. Yet, there is no robust way to analyze packages and measure risks. Metrics such as Github stars/forks are attacker-controlled and can be faked.

In this presentation, we will present a data-driven security analysis framework, called PACKJ, to measure, and control the level of potential supply chain risks when adopting open-source packages. The framework relies on empirically identified (and validated) “risky” code and metadata attributes that makes a package vulnerable to supply chain attacks. Examples include the use of filesystem/network APIs, lack of two-factor authentication, and metadata impersonation. PACKJ employs static code analysis, dynamic tracing, and metadata checks for detecting the presence (or absence) of such risky attributes.

Using our security framework, we have built a large-scale automated system for continuous vetting of packages, and have already identified several abandoned and malicious packages. In this presentation, we will discuss our tool, highlight our findings as well as different types of attacks, and demo our tool to detect “risky” packages and mitigate supply chain attacks.