News for hackers. Stuff that matters.
Re:Malicious software libraries found in PyPI posing as well... by rantanplan on Friday September 15, 2017 @07:29AM (#15256205)
The regex they have for identifying fake/harmful packages is wrong.

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

This incorrectly lists `urllib3` or the `cryptography` package for example, which are perfectly valid packages.

[UPDATE]

Read "tobltobs" comment below. I incorrectly removed a trailing space from the regex.

Re:Malicious software libraries found in PyPI posing as well... by tobltobs on Friday September 15, 2017 @07:39AM (#15256252)
Not for me. There is space at the end between the closing bracket and the apostrophe. Maybe you did remove this space when you corrected the smart apostrophes.
Re:Malicious software libraries found in PyPI posing as well... by rantanplan on Friday September 15, 2017 @07:44AM (#15256275)
You're right. It seems I did remove the space. When I put it back in it doesn't print anything.
Re:Malicious software libraries found in PyPI posing as well... by osteele on Friday September 15, 2017 @10:32AM (#15257451)
Conda users: Here's a script that runs this check against each environment:

https://gist.github.com/osteele/198b50a2a208e5bc7e5fb8d010cf...

Re:Malicious software libraries found in PyPI posing as well... by nariinano on Friday September 15, 2017 @07:38AM (#15256249)
I believe urllib3 is built-in. So if you have installed it from PyPI you've gotten a malicious version.
Re:Malicious software libraries found in PyPI posing as well... by cpburns2009 on Friday September 15, 2017 @07:53AM (#15256321)
urllib and urllib2 are built-in for Python 2, and were merged and reorganized as just urllib in Python 3. urllib3 is a third-party module.
Re:Malicious software libraries found in PyPI posing as well... by haikuginger on Friday September 15, 2017 @09:11AM (#15256826)
This is correct. In general, though, most packages don't rely on urllib3 directly, but on `requests`, which uses urllib3 but provides a friendlier API and built-in SSL cert verification.
Re:Malicious software libraries found in PyPI posing as well... by wyldfire on Friday September 15, 2017 @07:56AM (#15256336)
It's not generally true that built-in packages which also appear on PyPI are malicious.

Many batteries-included packages are also maintained outside of CPython. This is because: (1) in many cases they existed outside prior to being included in CPython, (2) they can experiment with new features before they're included in the CPython version of their package.

Re:Malicious software libraries found in PyPI posing as well... by rantanplan on Friday September 15, 2017 @07:45AM (#15256280)
Re:Malicious software libraries found in PyPI posing as well... by julianj on Friday September 15, 2017 @09:23AM (#15256912)
xml should be added to this list.

https://pypkg.com/pypi/xml/f/setup.py

Re:Malicious software libraries found in PyPI posing as well... by jastr on Friday September 15, 2017 @11:16AM (#15257810)
pip list --format=legacy | cut -d' ' -f1 | xargs egrep '^(acqusition|apidev-coop|bzip|crypt|django-server|pwd|setup-tools|telnet|urlib3|urllib)$'
Re:Malicious software libraries found in PyPI posing as well... by pmoriarty on Friday September 15, 2017 @02:48PM (#15259654)
When running that command, I get output like this:

  grep: alabaster: No such file or directory
  grep: appdirs: No such file or directory
  grep: arandr: No such file or directory
for dozens and dozens of packages. Are those errors benign?
Re:Malicious software libraries found in PyPI posing as well... by jwilk on Friday September 15, 2017 @03:33PM (#15260070)
No, jastr's command is wrong.
Re:Malicious software libraries found in PyPI posing as well... by jastr on Friday September 15, 2017 @03:51PM (#15260223)
Whoops, remove the xargs