Live data from Hacker News

Devs unknowingly use “malicious” modules snuck into official Python repository

arstechnica.com

11–20 of 119 posts

Re: Devs unknowingly use “malicious” modules snuck into official Python repository

#11
post #2

One nice thing about languages like C is that a lot of programmers just avoid dependencies because dealing with them kind of sucks. That's one solution to this problem.

you're not wrong. once i wrote a whole blog post about how to properly include Boost into C++ code using a particular IDE.

Re: Devs unknowingly use “malicious” modules snuck into official Python repository

#12
post #2

One nice thing about languages like C is that a lot of programmers just avoid dependencies because dealing with them kind of sucks. That's one solution to this problem.

I love Python for this. Big standard library. I hate JavaScript for this... So many weird legacy issues that generally get resolved with libraries. Though ES6 went a long long way.

Re: Devs unknowingly use “malicious” modules snuck into official Python repository

#13
post #10

How do you check if you are affected?

The advisory has a regex, but it's not formatted well for copy-paste (non-ASCII quotes!). Here's a version that works: pip list –format=legacy | egrep ‘^(acqusition|apidev-coop|bzip|crypt|django-server|pwd|setup-tools|telnet|urlib3|urllib) ‘

It appears that your version has non-ascii quotes as well.

Re: Devs unknowingly use “malicious” modules snuck into official Python repository

#14
post #2

One nice thing about languages like C is that a lot of programmers just avoid dependencies because dealing with them kind of sucks. That's one solution to this problem.

It is good for security research, since that introduces so many security holes of such wonderful diversity that there is a much larger ecosystem to study.

Re: Devs unknowingly use “malicious” modules snuck into official Python repository

#17
The casual culture of pulling in hundred of dependencies, and mushrooming language specific package managers is ridiculously insecure and has to go.

There is no way for anyone to know what all this code is doing, there is little way to verify updates and its simply untenable.

If some developers like this sort of unsafe practice it should be strictly limited to their machines and in no way make it across in any form as a deployment artifact.

There are already secure distribution package managers with the necessary infrastructure, you are not special, use those. Ruby is already paying a price for imposing dependency hell of users and wasting millions of man hours. Many have suffered and do not even bother with Ruby apps anymore. Node and others who think this is a good model will be next. Users should simply boycott such user hostile developers and languages that encourage this kind of insecurity.

Re: Devs unknowingly use “malicious” modules snuck into official Python repository

#18
The IP address it phones home to, 121.42.217.44, is located in China and visiting it with HTTP just displays this interesting message:

    Hi bro :)

    Welcome Here!

    Leave Messages via HTTP Log Please :)


    On 2017-09-16:

    Happy to see somebody find it ! :)

    Just curious about how long it would take for people to find those 'bad' packages

    As you see, that's just a toy script, no harm, hope you enjoy it !
It looks like someone (security researcher?) just set up a PoC and didn't intend to actually "weaponise" it.

Re: Devs unknowingly use “malicious” modules snuck into official Python repository

#19
post #10

Earlier quoted context omitted.

The advisory has a regex, but it's not formatted well for copy-paste (non-ASCII quotes!). Here's a version that works: pip list –format=legacy | egrep ‘^(acqusition|apidev-coop|bzip|crypt|django-server|pwd|setup-tools|telnet|urlib3|urllib) ‘

It appears that your version has non-ascii quotes as well.

It's the ',

pip list –format=legacy | egrep '^(acqusition|apidev-coop|bzip|crypt|django-server|pwd|setup-tools|telnet|urlib3|urllib) '

works for me

Re: Devs unknowingly use “malicious” modules snuck into official Python repository

#20
post #17

The casual culture of pulling in hundred of dependencies, and mushrooming language specific package managers is ridiculously insecure and has to go. There is no way for anyone to know what all this code is doing, there is little way to verify updates and its simply untenable. If some developers like this sort of unsafe practice it should be strictly limited to their machines and in no way make it across in any form a…

NPM is my primary reason for not using NodeJS. I installed a specific package in an empty project and got over 690 dependencies. For running `npm install {package-name}`.

What's worse is that I skimmed the tree to check for anything particularly heinous, but there was nothing that stood out as unneeded.

With such a tiny stdlib, especially out of the browser environment, there's not really a better alternative than to make it easy to include dependencies for your dependencies. Without NPM, the Node community would be tiny if not already dead.

I don't have a better idea either. For my purposes, it just means I use a different language, but that's not really a solution.

Post reply on HN