Papers for

nodejs developers

Papers whose findings have a practical use for this group, as judged from the abstract. Open a paper to read what it means in practice.

Malicious NPM package detection with lightweight static and AI analysis

DistillGuard: Malicious NPM Package Detection and API Attack Chain Analysis via Static Graph and LLM Distillation

Abstract: The Node.js ecosystem heavily relies on NPM packages, and software supply chain attacks targeting malicious NPM packages are rampant. Malicious code primarily triggers during package installation, import, and runtime. Traditional static analysis fails to understand code semantics; machine learning-based methods rely on feature extraction, which suffers from concept drift; existing LLM solutions suffer from high invocation costs, high data security risks, and poor performance. To overcome these limitations, we propose DistillGuard, a lightweight malicious NPM package detection framework that combines static graph semantic analysis and LLM knowledge distillation. DistillGuard first acquires multi-granular features through three static analysis modules. Then, it leverages online LLM to distill high-quality security knowledge and structured labels. Finally, it uses LoRa to efficiently fine-tune the open-source Qwen3-8B model to support offline deployment. Experiments show that DistillGuard achieves an accuracy of 95.3\%, a precision of 99.4\%, and an F1 score of 93.8\%, outperforming state-of-the-art tools, improving the F1-score by 11.1 to 30.0 percentage points over the baselines. Our empirical research further reveals the stages of malicious attacks and the distribution of malicious behaviors. We also summarized eight typical API attack chains for malicious activities, providing practical insights for NPM supply chain security defense.

Thu 24 SeptCryptography and Security
The gist
NPM packages are used widely in software, but some contain harmful code that can cause damage when installed or run. Existing methods to find these bad packages either miss important details or are too costly and risky to use. The authors developed DistillGuard, a tool that uses detailed code analysis and a small AI model to detect malicious packages accurately and quickly. Their tests show DistillGuard works better than previous tools and also helps understand how these malicious packages attack systems.
Open → 2609.28996v1