On the feasibility of detecting injections in malicious npm packages

Simone Scalco, Ranindya Paramitha, Duc Ly Vu, Fabio Massacci

Research output: Chapter in Book / Report / Conference proceedingConference contributionAcademicpeer-review

Abstract

Open-source packages typically have their source code available on a source code repository (e.g., on GitHub), but developers prefer to use pre-built artifacts directly from the package repositories (such as npm for JavaScript). Between the source code and the distributed artifacts, there could be differences that pose security risks (e.g., attackers deploy malicious code during package installation) in the software supply chain. Existing package scanners focus on the entire artifact of a package to detect this kind of attacks. These procedures are not only time consuming, but also generate high irrelevant alerts (FPs). An approach called LastPyMile by Vu et al. (ESEC/FSE'21) has been shown to be effective in detecting discrepancies and reducing false alerts in vetting Python packages on PyPI by focusing only on the differences between the source and the package. In this work, we propose to port that approach to scan JavaScript packages in the npm ecosystem. We presented a preliminary evaluation of our implementation on a set of real malicious npm packages and the top popular packages. The results show that while being 20.7x faster than git-log approach, our approach managed to reduce the percentage of false alerts produced by package scanner by 69%.

Original languageEnglish
Title of host publicationARES '22
Subtitle of host publicationProceedings of the 17th International Conference on Availability, Reliability and Security
PublisherAssociation for Computing Machinery
Pages1-8
Number of pages8
ISBN (Electronic)9781450396707
DOIs
Publication statusPublished - Aug 2022
Event17th International Conference on Availability, Reliability and Security, ARES 2022 - Vienna, Austria
Duration: 23 Aug 202226 Aug 2022

Publication series

NameACM International Conference Proceeding Series

Conference

Conference17th International Conference on Availability, Reliability and Security, ARES 2022
Country/TerritoryAustria
CityVienna
Period23/08/2226/08/22

Bibliographical note

Funding Information:
This research was done while Duc-Ly Vu was with the University of Trento. This work has been partly supported by the European Union H2020 Program under the Grant 952647 (AssureMOSS - www. assuremoss.eu).

Publisher Copyright:
© 2022 ACM.

Funding

This research was done while Duc-Ly Vu was with the University of Trento. This work has been partly supported by the European Union H2020 Program under the Grant 952647 (AssureMOSS - www. assuremoss.eu).

Keywords

  • JavaScript
  • npm
  • Open source software
  • software supply chain

Fingerprint

Dive into the research topics of 'On the feasibility of detecting injections in malicious npm packages'. Together they form a unique fingerprint.

Cite this