[论文解读] Supporting the Detection of Software Supply Chain Attacks through Unsupervised Signature Generation
本文提出ACME,一种无监督方法,通过抽象语法树(ASTs)和马尔可夫聚类算法(MCL)基于语法相似性聚类恶意npm包,以检测软件供应链攻击。该方法在重现人工聚类时F₁得分为0.99,并通过基于签名的自动扫描在npm注册表中识别出六个此前未报告的恶意包。
Trojanized software packages used in software supply chain attacks constitute an emerging threat. Unfortunately, there is still a lack of scalable approaches that allow automated and timely detection of malicious software packages and thus most detections are based on manual labor and expertise. However, it has been observed that most attack campaigns comprise multiple packages that share the same or similar malicious code. We leverage that fact to automatically reproduce manually identified clusters of known malicious packages that have been used in real world attacks, thus, reducing the need for expert knowledge and manual inspection. Our approach, AST Clustering using MCL to mimic Expertise (ACME), yields promising results with a $F_{1}$ score of 0.99. Signatures are automatically generated based on characteristic code fragments from clusters and are subsequently used to scan the whole npm registry for unreported malicious packages. We are able to identify and report six malicious packages that have been removed from npm consequentially. Therefore, our approach can support analysts by reducing manual labor and hence may be employed to timely detect possible software supply chain attacks.
研究动机与目标
- 解决软件供应链中恶意软件包缺乏可扩展、自动检测方法的问题。
- 减少在识别被后门的包时对人工分析和专家知识的依赖。
- 基于代码相似性自动聚类已知的恶意包,以支持及时检测。
- 从聚类中生成无监督、可重用的签名,用于扫描大型代码仓库(如npm)以发现此前未见的恶意包。
- 通过支持主动扫描,提升检测速度,并将恶意包平均移除时间从200天缩短。
提出的方法
- 从已知恶意npm包的源代码中提取抽象语法树(ASTs),以表示其语法结构。
- 使用结构比较技术计算AST之间的成对相似度得分,以识别具有高度相似性的代码片段。
- 应用马尔可夫聚类算法(MCL)将相似的AST聚合成簇,模拟专家驱动的恶意软件家族分组。
- 从每个簇中的代表性代码片段生成检测签名,以支持新包的扫描。
- 通过移除与npm中108个最常被依赖的包匹配的签名,减少误报。
- 使用生成的签名对npm注册表进行全面扫描,以检测未报告的恶意包。
实验结果
研究问题
- RQ1无监督的AST聚类能否有效重现专家识别的恶意npm包聚类?
- RQ2基于AST的相似性检测在最小人工干预下,对已知恶意包的识别效果如何?
- RQ3自动生成的签名在大型代码仓库中检测未知恶意包的能力有多强?
- RQ4签名过滤过程在保持检测覆盖率的同时,减少误报的效果如何?
- RQ5该方法能否扩展至在大型软件生态系统中检测已知恶意软件家族的新变种?
主要发现
- ACME在重现114个已知恶意npm包的手动聚类时,F₁得分为0.99。
- 该方法通过基于签名的扫描,成功识别出npm注册表中七个此前未报告的恶意包。
- 其中四个被确认为恶意包,并已报告给npm,已被移除。
- 其余三个包中的两个为概念验证变种,一个包含对已知恶意依赖的直接复制。
- 每簇移除50个匹配度最高的误报指纹后,总匹配数减少了约50%,证明了误报清理的可行性。
- 该方法对常见的代码混淆技术具有鲁棒性,如变量重命名(类型1和类型2克隆)及微小结构变化(类型3克隆)。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。