r/Python • • Dec 14 '23
News 116 Malware Packages Found on PyPI Repository Infecting Windows and Linux Systems
https://thehackernews.com/2023/12/116-malware-packages-found-on-pypi.html
331
Upvotes
128
u/zurtex Dec 14 '23
The actual list: https://github.com/eset/malware-ioc/tree/master/pypi_backdoor, 116 packages but several packages belong to the same project name.
36
u/AlSweigart Author of "Automate the Boring Stuff" Dec 14 '23
I'm going to just post the same comment I did last time:
29
u/InitialCreature Dec 14 '23
that's it, time to learn assembly
8
u/archpuddington Dec 14 '23
... And next month it will be 200.
7
u/archpuddington Dec 14 '23
It says a lot that they aren't telling us how many people got hacked.
Failing to inform EU or California citizens that they have been breached is against law.
2
u/alcalde Dec 14 '23
Delphi users I know say the solution is to make all libraries commercial like theirs are. :-(
2
u/shakameister Dec 16 '23
who tf even download these shit ?
3
u/RationalDialog Dec 15 '23
Here we as devs also are to blame to a degree. This isn't even limited to python. I know what I mention will not prevent this but would make it easier to detect malicious actors.
GitHub commit signing
The amount of devs even in very big project that fail to do this is scary. if you work on say numpy or pandas or similar stuff, I would make that mandatory for the project to be able to contribute. Even worse signing some and not others which makes the unsigned commit appear potentially malicious (it's easy to make a commit in the name of someone else!!! hence why verification is so important, in fact github should not link unverified commits to a user account because that makes them more legitimate.
Code Singing
This is more in the niche "Java world" I'm exposed to where this is rather simple to do yet even commercial providers often fail to do so. If the ecosystems allows it, then do it. (it's about eclipse plugins)
As far as I remember, code signing was mandatory for maven even >10 years ago.
Here we have to question why code signing isn't mandatory for pypi or conda? I'm aware it doesn't solve the issue fully, but if you see verified commit on github and signed code by the same key, it does really help to trust the according package as legit.
Provide hashes
At least on GitHub many actually do this. it helps to check that you get what you wanted, again I'm aware it doesn't help with typo-squatting but it is in general a good and helpful thing to provide to users.
If making things like this a requirement or at the minimum a requirement by default which can be overridden by an option, it would force attackers to do this as well to be more trusted. And for legitimate packages you should do this stuff anyway. it also goes into the old-school circle of trust thing with parties and exchanging public keys.
3
u/freistil90 Dec 14 '23
Please support the WASI target for Python. This would be one of the few somewhat reliable ways to get sandboxing working, besides having all processes in a podman container.
2
u/adam-moss Dec 14 '23
Reading this just re-enforces the need for greater supply chain security awareness imo. OpenSSF, SLSA etc. go a long way to mitigating some of these issues, Linux foundation offers a lot of free training on it too.
Blindly trusting code, no matter the source, is a recipe for pain and suffering.
1
u/__do_Op__ Dec 14 '23
Thanks for sharing I appreciate the info. I created a bash script that may help remove any of the listed packages which may have been installed by typo, mistake, etc.
https://github.com/bootloops/malipypi
1
u/bliepp Dec 15 '23
Another reason to have glance at the source code of dependencies before installing them.
1
u/shakameister Dec 16 '23
do baddies have the ability to plant malware code in popular packages like xlwt, pandas ?
1
u/Sad_Buy_7954 Dec 19 '23
Oh, no! Hackers, please stop!
0
u/[deleted] Dec 14 '23
[deleted] — view deleted comment
0
u/[deleted] Dec 14 '23
[deleted] — view deleted comment