Databricks研究:LLM难判npm二进制恶意包
Databricks 博客介绍其自 2025 年 11 月起收集 npm 恶意样本的研究:在经 OSV 恶意包公告核实的 11,413 个包版本中,96.2% 将载荷藏在源码或从外部服务器获取,3.8%(432 个)捆绑二进制文件。作者称,捆绑二进制的包未能得到明确恶意判定的比例是仅含源码包的两倍以上(14.4% 对 6.2%),并把失败模式归纳为忽视、骑墙、编造理由,以及混淆程度越高判定反而越轻。研究提出在推理阶段注入预计算的静态证据与领域知识,称这可同时改善低成本与前沿模型的检测质量。
捆绑二进制的 npm 包虽然少见,却让 LLM 分诊更棘手,且报告称失败模式跨模型层级出现,因此推理阶段注入领域知识对 AI 辅助供应链安全具有参考价值。
Introduction
Supply chain attacks on package registries have grown in volume and sophistication [1]. Public research regularly observes malware being deployed to the npm registry by a range of threat actors, from spam campaigns [2] to the steady proliferation of DPRK malware [3, 4, 5], and to the high-impact TeamPCP in 2025 and 2026 [6, 7], with the DPRK and TeamPCP actors having a track record of successfully compromising widely used open source projects for maximized downstream reach [8].
To study this problem directly, we have been collecting npm malware samples since November 2025, and observed that, among the 11,413 package-versions we scanned and corroborated through OSV npm malware advisories [9], most malware on the npm registry hides its payload in the package source or fetches it from an external server, accounting for 96.2% of the corroborated dataset. The remaining 3.8%, 432 package-versions, bundle a binary. Though small in volume, they can carry disproportionate risk during triage. A stripped, opaque binary that carries no source for tools to read can be nested within a facade of clean source and metadata and potentially skew an LLM towards a benign verdict.
#Databricks#npm#OSV#YARA#Semgrep#Qwen3-Next#GPT-5.4-nano#Gemini#Haiku