A Closer Look at the Quality of NPM Dataset for Malicious Code Detection

The rapid growth of the NPM ecosystem has raised concerns over malicious packages and supply chain attacks. Numerous approaches for detecting malicious code have been proposed and evaluated on public datasets, often reporting near-perfect performance. However, continuing attack incidents motivate a closer examination of the datasets used for evaluation. In this paper, we conduct the first comprehensive empirical study on the quality of datasets for NPM malicious code detection, focusing on sample duplication, attack-type coverage, and detection complexity. We find that existing datasets exhibit severe semantic duplication, with on average 65.5% of samples being lightweight variants of the same attack behaviors; severe attack-type skew; and limited complexity, where most attacks are explicitly and immediately triggered. To study how these properties affect reported performance, we construct a curated dataset by removing duplicates and annotating malicious-types across five public datasets. We reproduce four state-of-the-art detection approaches on the curated dataset and evaluate their performance under different settings. Our results show that semantic duplication, attack-type imbalance, and low-complexity samples substantially affect reported performance, reducing recall by up to 20%. We discuss the implications and provide actionable recommendations for constructing and evaluating future datasets for software supply chain security.

Authors

Publication Details

Journal
arXiv
Published
2026-12-01
Primary Topic
Advanced Malware Detection Techniques
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

A Closer Look at the Quality of NPM Dataset for Malicious Code Detection

Yiheng Huang, Xuetao Li, Hui Liu, Bohan Wang et al.
arXiv
Advanced Malware Detection Techniques
preprint

A Closer Look at the Quality of NPM Dataset for Malicious Code Detection

Yiheng Huang, Xuetao Li, Hui Liu, Bohan Wang, Yuxia Zhang, Bihuan Chen
preprint en

Abstract

The rapid growth of the NPM ecosystem has raised concerns over malicious packages and supply chain attacks. Numerous approaches for detecting malicious code have been proposed and evaluated on public datasets, often reporting near-perfect performance. However, continuing attack incidents motivate a closer examination of the datasets used for evaluation. In this paper, we conduct the first comprehensive empirical study on the quality of datasets for NPM malicious code detection, focusing on sample duplication, attack-type coverage, and detection complexity. We find that existing datasets exhibit severe semantic duplication, with on average 65.5% of samples being lightweight variants of the same attack behaviors; severe attack-type skew; and limited complexity, where most attacks are explicitly and immediately triggered. To study how these properties affect reported performance, we construct a curated dataset by removing duplicates and annotating malicious-types across five public datasets. We reproduce four state-of-the-art detection approaches on the curated dataset and evaluate their performance under different settings. Our results show that semantic duplication, attack-type imbalance, and low-complexity samples substantially affect reported performance, reducing recall by up to 20%. We discuss the implications and provide actionable recommendations for constructing and evaluating future datasets for software supply chain security.

arXiv
Advanced Malware Detection Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon