MalPacDetector: An LLM-Based Malicious NPM Package Detector

The Node Package Manager (NPM) registry contains millions of JavaScript packages widely shared between worldwide developers. However, NPM has also been abused by attackers to spread malicious packages, highlighting the importance of detecting malicious NPM packages. Existing malicious NPM package detectors suffer from, among other things, high false positives and/or high false negatives. In this paper, we propose a novel Malicious NPM Package Detector (MalPacDetector), which leverages Large Language Model (LLM) to automatically and dynamically generate features (rather than asking experts to manually define them). To evaluate the effectiveness of Mal-PacDetector and existing detectors, we construct a new NPM package dataset, which overcomes the weaknesses of existing datasets (e.g., a small number of examples and a high repetition rate of malicious fragments). The experimental results show that MalPacDetector outperforms existing detectors by achieving a false positive rate of 1. 3% and a false negative rate of 7. 5%. In particular, MalPacDetector detects 39 previously unknown malicious packages, which are confirmed by the NPM security team.

Authors

Institutions

Publication Details

Journal
IEEE Transactions on Information Forensics and Security
Published
2025-01-01
DOI
https://doi.org/10.1109/tifs.2025.3580336
Citations
3
Primary Topic
Network Security and Intrusion Detection
Type
article
Field-Weighted Citation Impact
4.46

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

MalPacDetector: An LLM-Based Malicious NPM Package Detector

Shouhuai Xu, Hai Jin, Jun‐e Qu, Z. Wang et al.
3 citations
IEEE Transactions on Information Forensics and Security
Network Security and Intrusion Detection
4.46
article

MalPacDetector: An LLM-Based Malicious NPM Package Detector

Shouhuai Xu, Hai Jin, Jun‐e Qu, Z. Wang, Deqing Zou, Zhen Li, Jian Wang, Z. Xu
article en
3 citations

Abstract

The Node Package Manager (NPM) registry contains millions of JavaScript packages widely shared between worldwide developers. However, NPM has also been abused by attackers to spread malicious packages, highlighting the importance of detecting malicious NPM packages. Existing malicious NPM package detectors suffer from, among other things, high false positives and/or high false negatives. In this paper, we propose a novel Malicious NPM Package Detector (MalPacDetector), which leverages Large Language Model (LLM) to automatically and dynamically generate features (rather than asking experts to manually define them). To evaluate the effectiveness of Mal-PacDetector and existing detectors, we construct a new NPM package dataset, which overcomes the weaknesses of existing datasets (e.g., a small number of examples and a high repetition rate of malicious fragments). The experimental results show that MalPacDetector outperforms existing detectors by achieving a false positive rate of 1. 3% and a false negative rate of 7. 5%. In particular, MalPacDetector detects 39 previously unknown malicious packages, which are confirmed by the NPM security team.

IEEE Transactions on Information Forensics and SecurityVol. 20
Jilian Technology Group (China) (CN), Huazhong University of Science and Technology (CN), University of Colorado Colorado Springs (US)
National Natural Science Foundation of China
Openalex Percentile: Top 5%
Network Security and Intrusion Detection
4.46
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.