[Paper Review] Supporting the Detection of Software Supply Chain Attacks through Unsupervised Signature Generation
This paper proposes ACME, an unsupervised method that uses Abstract Syntax Trees (ASTs) and the Markov Cluster Algorithm (MCL) to detect software supply chain attacks by clustering malicious npm packages based on syntactic code similarities. It achieves an F₁ score of 0.99 in reproducing manual clusters and identified six previously unreported malicious packages in the npm registry through automated signature-based scanning.
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.
Motivation & Objective
- Address the lack of scalable, automated detection methods for malicious software packages in software supply chains.
- Reduce reliance on manual analysis and expert knowledge in identifying trojanized packages.
- Automate the clustering of known malicious packages based on code similarities to support timely detection.
- Generate unsupervised, reusable signatures from clusters to scan large repositories like npm for previously unseen malicious packages.
- Improve detection speed and reduce the 200-day average time-to-removal of malicious packages by enabling proactive scanning.
Proposed method
- Extract Abstract Syntax Trees (ASTs) from source code of known malicious npm packages to represent syntactic structure.
- Compute pairwise similarity scores between ASTs using structural comparison techniques to identify code fragments with high similarity.
- Apply the Markov Cluster Algorithm (MCL) to group similar ASTs into clusters, mimicking expert-driven malware family grouping.
- Generate detection signatures from representative code fragments within each cluster to enable scanning of new packages.
- Filter signatures by removing matches to the 108 most depended-upon npm packages to reduce false positives.
- Perform a full registry scan of npm using generated signatures to detect unreported malicious packages.
Experimental results
Research questions
- RQ1Can unsupervised clustering of ASTs effectively reproduce expert-identified clusters of malicious npm packages?
- RQ2How well can AST-based similarity detection identify known malicious packages with minimal manual intervention?
- RQ3To what extent can automatically generated signatures detect previously unknown malicious packages in large repositories?
- RQ4How effective is the signature filtering process in minimizing false positives while preserving detection coverage?
- RQ5Can the approach be scaled to detect new variants of known malware families across large software ecosystems?
Key findings
- ACME achieved an F₁ score of 0.99 in reproducing manually curated clusters of 114 known malicious npm packages.
- The method successfully identified seven previously unreported malicious packages in the npm registry through signature-based scanning.
- Four of the seven detected packages were confirmed malicious and reported to npm, resulting in their removal.
- Two of the remaining three packages were proof-of-concept variants, and one contained a direct copy of a known malicious dependency.
- Removing the 50 most matching false-positive fingerprints per cluster reduced total matches by approximately 50%, demonstrating the feasibility of false positive cleanup.
- The approach is resilient to common code obfuscation techniques such as variable renaming (Type-1 and Type-2 clones) and minor structural changes (Type-3 clones).
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.