CFP last date
21 December 2026
Reseach Article

Slopsquatting-Aware Detection of Malicious PyPI Packages via Interpretable Multi-Signal Risk Fusion

by Mohanad Ali Al-Alwan, Ahmad Hweishel A. Alfarjat, Wael Ibrahim A. Almazaydeh, Rajesha N.
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
Volume 187 - Number 154
Year of Publication: 2026
Authors: Mohanad Ali Al-Alwan, Ahmad Hweishel A. Alfarjat, Wael Ibrahim A. Almazaydeh, Rajesha N.
10.5120/ijcac5359e5ec96e

Mohanad Ali Al-Alwan, Ahmad Hweishel A. Alfarjat, Wael Ibrahim A. Almazaydeh, Rajesha N. . Slopsquatting-Aware Detection of Malicious PyPI Packages via Interpretable Multi-Signal Risk Fusion. International Journal of Computer Applications. 187, 154 ( Nov 2026), 1-8. DOI=10.5120/ijcac5359e5ec96e

@article{ 10.5120/ijcac5359e5ec96e,
author = { Mohanad Ali Al-Alwan, Ahmad Hweishel A. Alfarjat, Wael Ibrahim A. Almazaydeh, Rajesha N. },
title = { Slopsquatting-Aware Detection of Malicious PyPI Packages via Interpretable Multi-Signal Risk Fusion },
journal = { International Journal of Computer Applications },
issue_date = { Nov 2026 },
volume = { 187 },
number = { 154 },
month = { Nov },
year = { 2026 },
issn = { 0975-8887 },
pages = { 1-8 },
numpages = {9},
url = { https://ijcaonline.org/archives/volume187/number154/slopsquatting-aware-detection-of-malicious-pypi-packages-via-interpretable-multi-signal-risk-fusion/ },
doi = { 10.5120/ijcac5359e5ec96e },
publisher = {Foundation of Computer Science (FCS), NY, USA},
address = {New York, USA}
}
%0 Journal Article
%1 2026-11-25T01:50:06+05:30
%A Mohanad Ali Al-Alwan
%A Ahmad Hweishel A. Alfarjat
%A Wael Ibrahim A. Almazaydeh
%A Rajesha N.
%T Slopsquatting-Aware Detection of Malicious PyPI Packages via Interpretable Multi-Signal Risk Fusion
%J International Journal of Computer Applications
%@ 0975-8887
%V 187
%N 154
%P 1-8
%D 2026
%I Foundation of Computer Science (FCS), NY, USA
Abstract

PyPI accepts uploads from anyone, and the code in a package runs as soon as the package is installed. Attackers have used this for years. More recently, coding assistants based on large language models (LLMs) have created another opening, because they sometimes recommend packages that do not exist. If an attacker registers such an invented name (slopsquatting), developers who follow the model’s advice install the attacker’s package. This paper describes a static detector for malicious PyPI packages that looks at three kinds of evidence in each upload: the code that runs at install time, the metadata stored in the archive, and the risk carried by the package name, which includes a check against names that LLMs are known to hallucinate. The three scores are merged with learned weights that cannot be negative and must add up to one, so for any alert an analyst can see how much each kind of evidence contributed. For testing, 1,569 malicious packages were taken from Datadog’s public collection, and 1,313 benign ones were downloaded from PyPI, some popular and some rarely used. Five-fold cross-validation gave F1 = 0.969 (bootstrap interval 0.964 to 0.976) with 1.6% of benign packages flagged. When the threshold was set so that only one benign package in a thousand is flagged, 89.7% of the malware was still detected, compared with 40.3% for code analysis alone. On the same 533 packages, the threat rules of the GuardDog scanner gave an FPR of 23.8% against 2.1% for the proposed score (McNemar test, p < 10−12). Performance fell to an F1 score of 0.862 for attacks first reported in 2025–2026, and only 3 of 17 compromised releases of legitimate libraries were detected.

References
  1. M. Ohm, H. Plate, A. Sykosch, and M. Meier, “Backstabber’s knife collection: A review of open source software supply chain attacks,” in Proc. DIMVA, LNCS, vol. 12223. Springer, 2020, pp. 23–43.
  2. P. Ladisa, H. Plate, M. Martinez, and O. Barais, “SoK: Taxonomy of attacks on open-source software supply chains,” in Proc. IEEE Symp. Security and Privacy (S&P), 2023, pp. 1509–1526.
  3. W. Guo, Z. Xu, C. Liu, C. Huang, Y. Fang, and Y. Liu, “An empirical study of malicious code in PyPI ecosystem,” in Proc. IEEE/ACM ASE, 2023.
  4. A. Freund, “Backdoor in upstream xz/liblzma leading to ssh server compromise,” oss-security mailing list, Mar. 29, 2024. CVE-2024-3094.
  5. Datadog Security Labs, “Open-source dataset of malicious software packages,” 2023–2026. [Online]. Available: https://github.com/DataDog/ malicious-software-packages-dataset
  6. J. Spracklen, R. Wijewickrama, A. H. M. N. Sakib, A. Maiti, B. Viswanath, and M. Jadliwala, “We have a package for you! A comprehensive analysis of package hallucinations by code generating LLMs,” in Proc. USENIX Security Symp., 2025.
  7. A. Churilov, “The range shrinks, the threat remains: Re-evaluating LLM package hallucinations on the 2026 frontier-model cohort,” arXiv:2605.17062, 2026.
  8. B. Lanyado, “Diving deeper into AI package hallucinations,” Lasso Security, 2024.
  9. M. Taylor, R. Vaidya, D. Davidson, L. De Carli, and V. Rastogi, “Defending against package typosquatting,” in Proc. Int. Conf. Network and System Security (NSS), LNCS, vol. 12570. Springer, 2020, pp. 112–131.
  10. R. Duan, O. Alrawi, R. P. Kasturi, R. Elder, B. Saltaformaggio, and W. Lee, “Towards measuring supply chain attacks on package managers for interpreted languages,” in Proc. NDSS, 2021.
  11. A. Sejfia and M. Sch¨afer, “Practical automated detection of malicious npm packages,” in Proc. IEEE/ACM Int. Conf. Software Engineering (ICSE), 2022.
  12. J. Zhang, K. Huang, B. Chen, C. Wang, Z. Tian, and X. Peng, “Killing two birds with one stone: Malicious package detection in NPM and PyPI using a single model of malicious behavior sequence,” ACM Trans. Softw. Eng. Methodol. (TOSEM), 2025.
  13. OpenSSF, “Malicious packages repository.” [Online]. Available: https://github.com/ossf/ malicious-packages
  14. D. L. Vu, F. Massacci, I. Pashchenko, H. Plate, and A. Sabetta, “LastPyMile: Identifying the discrepancy between sources and packages,” in Proc. ACM ESEC/FSE, 2021, pp. 780–792.
  15. Datadog, “GuardDog: CLI tool to identify malicious PyPI and npm packages,” v3.2.0. [Online]. Available: https:// github.com/DataDog/guarddog
  16. M. U. Zeshan, M. Ibiyo, C. Di Sipio, P. T. Nguyen, and D. Di Ruscio, “Many hands make light work: An LLM-based multi-agent system for detecting malicious PyPI packages,” J. Syst. Softw., 2026, arXiv:2601.12148.
Index Terms

Computer Science
Information Sciences

Keywords

Software supply chain security malicious package detection PyPI slopsquatting package hallucination large language models