Understanding NPM Malicious Package Detection: A Benchmark-Driven Empirical Analysis

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Guo, Wenbo, Chen, Zhongwen, Xu, Zhengzi, Liu, Chengwei, Kang, Ming, Song, Shiwen, Liu, Chengyue, Xu, Yijia, Sun, Weisong, Liu, Yang
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914429904355328
author Guo, Wenbo
Chen, Zhongwen
Xu, Zhengzi
Liu, Chengwei
Kang, Ming
Song, Shiwen
Liu, Chengyue
Xu, Yijia
Sun, Weisong
Liu, Yang
author_facet Guo, Wenbo
Chen, Zhongwen
Xu, Zhengzi
Liu, Chengwei
Kang, Ming
Song, Shiwen
Liu, Chengyue
Xu, Yijia
Sun, Weisong
Liu, Yang
contents The NPM ecosystem has become a primary target for software supply chain attacks, yet existing detection tools are evaluated in isolation on incompatible datasets, making cross-tool comparison unreliable. We conduct a benchmark-driven empirical analysis of NPM malware detection, building a dataset of 6,420 malicious and 7,288 benign packages annotated with 11 behavior categories and 8 evasion techniques, and evaluating 8 tools across 13 variants. Unlike prior work, we complement quantitative evaluation with source-code inspection of each tool to expose the structural mechanisms behind its performance. Our analysis reveals five key findings. Tool precision-recall positions are structurally determined by how each tool resolves the ambiguity between what code can do and what it intends to do, with GuardDog achieving the best balance at 93.32% F1. A single API call carries no directional intent, but a behavioral chain such as collecting environment variables, serializing, and exfiltrating disambiguates malicious purpose, raising SAP_DT detection from 3.2% to 79.3%. Most malware requires no evasion because the ecosystem lacks mandatory pre-publication scanning. ML degradation stems from concept convergence rather than concept drift: malware became simpler and statistically indistinguishable from benign code in feature space. Tool combination effectiveness is governed by complementarity minus false-positive introduction, not paradigm diversity, with strategic combinations reaching 96.08% accuracy and 95.79% F1. Our benchmark and evaluation framework are publicly available.
format Preprint
id arxiv_https___arxiv_org_abs_2603_27549
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Understanding NPM Malicious Package Detection: A Benchmark-Driven Empirical Analysis
Guo, Wenbo
Chen, Zhongwen
Xu, Zhengzi
Liu, Chengwei
Kang, Ming
Song, Shiwen
Liu, Chengyue
Xu, Yijia
Sun, Weisong
Liu, Yang
Software Engineering
The NPM ecosystem has become a primary target for software supply chain attacks, yet existing detection tools are evaluated in isolation on incompatible datasets, making cross-tool comparison unreliable. We conduct a benchmark-driven empirical analysis of NPM malware detection, building a dataset of 6,420 malicious and 7,288 benign packages annotated with 11 behavior categories and 8 evasion techniques, and evaluating 8 tools across 13 variants. Unlike prior work, we complement quantitative evaluation with source-code inspection of each tool to expose the structural mechanisms behind its performance. Our analysis reveals five key findings. Tool precision-recall positions are structurally determined by how each tool resolves the ambiguity between what code can do and what it intends to do, with GuardDog achieving the best balance at 93.32% F1. A single API call carries no directional intent, but a behavioral chain such as collecting environment variables, serializing, and exfiltrating disambiguates malicious purpose, raising SAP_DT detection from 3.2% to 79.3%. Most malware requires no evasion because the ecosystem lacks mandatory pre-publication scanning. ML degradation stems from concept convergence rather than concept drift: malware became simpler and statistically indistinguishable from benign code in feature space. Tool combination effectiveness is governed by complementarity minus false-positive introduction, not paradigm diversity, with strategic combinations reaching 96.08% accuracy and 95.79% F1. Our benchmark and evaluation framework are publicly available.
title Understanding NPM Malicious Package Detection: A Benchmark-Driven Empirical Analysis
topic Software Engineering
url https://arxiv.org/abs/2603.27549