Search arXiv⌕ Search

arXiv subjects

Siyuan Pang

Publications and source records attributed to Siyuan Pang.

2 recordsLinked to original sources

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

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.

cs.CR↗

PYPILINE: Malicious PyPI Package Detection via Suspicious API Knowledge and Agent Workflow

Detecting malicious PyPI packages is crucial for maintaining the security of the open source software supply chain. Traditional static rule detection methods require continuous maintenance by experienced security personnel, resulting in high labor costs. Dynamic analysis methods require actual execution of the target package code, posing a risk of malicious code proliferation, and incurring significant runtime overhead and low detection efficiency. Machine learning and LLM methods iterate the detection kernel but cannot invoke multiple tools, resulting in insufficient automation.To address these issues, we propose a novel detection method called PYPILINE, which combines suspicious API knowledge and agent workflow. PYPILINE first performs static analysis on known malicious packages, extracting abstract syntax trees and generating API call graphs. From these graphs, a structured suspicious API knowledge base is extracted and constructed. In the agent workflow, PYPILINE uses RAG technology to invoke this knowledge base to enhance analytical capabilities, performing in-depth semantic analysis of the packages, outputting structured evaluation reports, and automatically sending the reports to a mail server.Experimental results show that PYPILINE achieves precision of 96.7\%, recall of 99.6\%, and F1 score of 98.1\%. F1 score is improved by 5.7 to 21.6 percentage points compared to baseline tools. When 30 threads execute concurrently, detecting a single package takes an average of only 0.6 seconds.Furthermore, we conducted a large scale empirical study of malware packages, systematically revealing common attack strategies and the most frequently abused APIs. PYPILINE provides an intelligent, efficient, and automated package detection solution, enhancing the security of the open source software ecosystem.

cs.CR↗