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

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.

Authors

Institutions

Publication Details

Journal
International Journal of Computer Applications
Published
2026-11-24
DOI
https://doi.org/10.5120/ijcac5359e5ec96e
Primary Topic
Advanced Malware Detection Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

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

Wa'el Ibrahim A. Almazaydeh, Rajesha N., Ahmad Hweishel A. Alfarjat, Mohanad Ali Al-Alwan
International Journal of Computer Applications
Advanced Malware Detection Techniques
article

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

Wa'el Ibrahim A. Almazaydeh, Rajesha N., Ahmad Hweishel A. Alfarjat, Mohanad Ali Al-Alwan
article en

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.

International Journal of Computer ApplicationsVol. 187(154)
Central Institute of Indian Languages (IN), Aqaba University of Technology (JO)
Advanced Malware Detection Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon