You Can't Touch This: Detecting Typosquatting Packages for Enhanced Malware Prevention in Software Supply Chains
Authors/Creators
Description
Short Summary
This record contains the dataset and code for the NSS 2024 paper "You Can't Touch This: Detecting Typosquatting Packages for Enhanced Malware Prevention in Software Supply Chains" (DOI 10.1007/978-981-96-3531-3_8).
It includes:
- Own Dataset: 406 typosquatting npm packages collected from Sonatype, Phylum.io and Snyk listings (397 with source code, 394 after removing 3 obfuscated packages).
- Backstabber's Knife Collection: a snapshot taken during our analysis, for reproduction purposes.
- MalOSS: a snapshot of the MalOSS dataset taken during our analysis, for reproduction purposes.
- Source code: the notebooks for package extraction, feature extraction and the Random Forest classifier, and the Extended Damerau-Levenshtein (EDL) metric.
The source code of the MalOSS and Backstabber's Knife Collection packages is not included and must be requested from their maintainers.
Warning: the Packages folder contains real malicious npm packages. Do not install or execute them; handle them only in an isolated environment.
Abstract
In recent years, typosquatting has become a significant threat to software supply chain systems, where malicious packages deceptively mimic legitimate ones. Attackers register these fraudulent packages with names strikingly similar to those of legitimate packages. As a result, developers can mistakenly download these malicious packages by mistyping the intended package name or selecting a package based on its convincing yet deceptive name. In this paper, we assess the effectiveness of string-matching algorithms in identifying potential typosquatting candidates. We construct an open dataset comprising 394 typosquatting packages and evaluate the performance of these algorithms based on their ability to detect typosquatting packages. In addition, we introduce a novel string-matching algorithm, an extension of the Damerau-Levenshtein distance, demonstrating a notably higher true-positive rate than existing methods. Since our dataset contains features not previously considered, we also investigate how these new features affect the assignment accuracy of ML-based classifiers. Our results show an overall accuracy rate of 98.4% on our datasets and 96.0% and 93.5% accuracy on evaluating two other open datasets. These results provide valuable insights for researchers, package manager vendors, and developers to improve their understanding of malicious typosquatting packages and improve mediation strategies and technologies.
Files
xMinhx/nss2024-typosquatting-mitigation-and-detection-v1.0.0.zip
Additional details
Related works
- Is supplement to
- Software: https://github.com/minh-tg/nss2024-typosquatting-mitigation-and-detection/tree/v1.0.0 (URL)
- Conference paper: 10.1007/978-981-96-3531-3_8 (DOI)
- References
- Conference paper: 10.1007/978-3-030-52683-2_2 (DOI)
- Conference paper: 10.14722/ndss.2021.23055 (DOI)
Dates
- Submitted
-
2024-09-29Camera Ready Version
Software
- Repository URL
- https://github.com/minh-tg/nss2024-typosquatting-mitigation-and-detection
- Programming language
- Python , Jupyter Notebook