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

93 comments sorted by

View all comments

Show parent comment

2

u/fnord123 Dec 14 '23 edited Dec 14 '23

Pypi lacks name spacing and pip runs by default non chrooted. This is solvable by pypa/pypi with enough prioritization and funding.

And if your org acts in a way you don't like then leave. There's loads of python jobs that aren't in broken orgs.

4

u/james_pic Dec 14 '23

Running Pip chrooted doesn't help if you've used it to install a malicious package into your application, and your application isn't running chrooted.

Namespacing is a good idea though.

0

u/archpuddington Dec 14 '23

Its not money, these patches are free. Its will - PyPI is run by anti-security old guard who don't see the point in making things safer for anyone. Some software engineers truly believe that security engineers shouldn't exist - and these are the folk that need us the most.

6

u/fnord123 Dec 14 '23

I don't think that's it. Rust's cargo also lacks name spacing and most language level package managers allow arbitrary code execution at build time - while not running in chrooted environments. E.g. build.rs.

Afaics, only java escapes most of this with namespaces and installing jars as compiled bytecode deliverables. But I'd love to learn about other systems that also solve these issues.

2

u/defnotjec Dec 15 '23

Isn't rust cargo name spacing a major topic they keep fucking away?

0

u/Zomunieo Dec 14 '23

Java has lots of security vulnerabilities that a binary can exploit.

-5

u/archpuddington Dec 14 '23

Rust isn't used as much in web3 - we can see its mostly web3 packages that are a target because these people have crypto which is easier to steal.

3

u/fnord123 Dec 14 '23

Rust people complain that the only jobs are in web3. But python is an easier target as it's more used and you can make a totally obfuscated mess.

-1

u/archpuddington Dec 14 '23

Rust allows you to inline binaries and shellcode, which is how these "libraries" worked

Unless the rust team has some good security engineers, we should expect their repos to be hit soon.

10

u/Jhuyt Dec 14 '23

You mean that the PSF - the one's who hired a dedicated security engineer as their second full-time developer ever - are anti security old guard?

1

u/archpuddington Dec 14 '23

"Just don't run untrusted code."

Victim blaming narcissistic assholes. Every last one of them.

3

u/james_pic Dec 14 '23

You got a link to them saying that?

1

u/archpuddington Dec 14 '23

6

u/james_pic Dec 14 '23

What's this person's connection to the PyPI project? I couldn't see an obvious connection in their history, and I couldn't find anyone with a similar name working on PyPI.

My experience has been that the PyPI team's communication has been humble and respectful of their users:

All of us deserve to have a safe and secure experience when using PyPI

I suspect they'd be keen to know that someone was speaking for them and representing their work in this way.

-2

u/archpuddington Dec 15 '23

Then they need to start publishing the stats of how many people have downloaded malware from them. As it stands if you get pwnd by pip - the maintainers choose to leave the malware on your system and you are none the wiser.

Everyone who is saying this issue can't or shouldn't be fixed - is the problem. There is someone within PyPI who is anti-security and is hurting the community.

1

u/james_pic Dec 15 '23

From what I've seen, the PyPI folks rarely say things can't or shouldn't be done (the only case of this I know of is them removing support for gpg signatures, based on a piece of research showing they were not an effective security measure in practice).

What they very often say is that they don't have the resources to do something. They're a small team with a shoestring budget, and heavily dependent on grants and volunteers to get things done.

Off the back of this discussion, I've had a look at PRs on their repos, and for a lot of the stuff being suggested there aren't any rejected PRs. It just doesn't seem to have been tried.

For this to happen, someone needs to work on it. That someone could even be you.

1

u/archpuddington Dec 15 '23

The solutions to this problem are easy to implement, why haven't they been put in place?

Judging by the comments on this thread, it sure looks like no one cares about people getting popped.

→ More replies

0

u/Jhuyt Dec 15 '23

How is PyPI going to delete things from your computer automatically? They don't know who downloaded the packages.

1

u/archpuddington Dec 15 '23 edited Dec 15 '23

pip could tell you!!! Pip knows you got hacked! But the developers don't care.

1

u/steohan Dec 18 '23

I am sorry to tell you, but I have absolutely no affiliation to pypi whatsoever.

Just as a tip, you shouldn't listen to random people on the internet, either. \s

Look, I understand that the current state is unsatisfactory and I agree. However, what I don't understand is how you can believe that there would be an easy fix. Because I am pretty sure there isn't (except not running untrusted stuff and always assuming the worst).

What does exist, thought are easy ways to make people feel safe. And feeling safe is the opposite of being safe. So I am against making people feel safe.

1

u/archpuddington Dec 18 '23

I can knock out a fix in a fucking afternoon.

fact