Live data from Hacker News

PyPI Blog: Project Quarantine

blog.pypi.org

11–20 of 62 posts

Re: PyPI Blog: Project Quarantine

#11
the fact that `pip install` just runs whatever is in `setup.py` is still mind baffling, even if the author weren't mallicious the `setup.py` can still do harm (say delete a file by mistake), there really needs to be an official way of sandbox its running.

Re: PyPI Blog: Project Quarantine

#12
post #5

Given how widespread PyPI usage is, I'm surprised they only have one full time security staff. I mean I guess it makes sense, usage doesn't always mean they get more donations/money, but damn.

companies that actually care about security have a more secure solution and don't allow devs to use pypi

Could you give some examples of more secure solutions?

Re: PyPI Blog: Project Quarantine

#13
post #5

Given how widespread PyPI usage is, I'm surprised they only have one full time security staff. I mean I guess it makes sense, usage doesn't always mean they get more donations/money, but damn.

companies that actually care about security have a more secure solution and don't allow devs to use pypi

For example we have it behind a kind of transparent proxy, where you get only packages which were tested and scan by a team of experts.

Re: PyPI Blog: Project Quarantine

#14

Earlier quoted context omitted.

companies that actually care about security have a more secure solution and don't allow devs to use pypi

You’d be surprised by the amount of companies handling critical infrastructure that are OK with using PyPI directly

That is somewhat terrifying

Re: PyPI Blog: Project Quarantine

#15
I see some comments about the lack of security of Pypi. And they are totally right, I’m also concerned. But to be fair, many other languages don’t fare better in that arena. I don’t want to give examples, but everyone knows horror histories with other languages.

Again, is not that because others are worse, is ok, but I would cut a little slack. Specially for the fact that having all packages somehow signed/audited would be a titanic task. And I guess I’m not willing to pay for it.

Re: PyPI Blog: Project Quarantine

#16
Quarantining projects is just a band-aid. If you’re worried about malware, maybe stop letting random people upload code to the official package index. Or just write better docs so people stop using random packages in the first place.

Re: PyPI Blog: Project Quarantine

#17

The still don't even have a way to avoid dependency confusion attacks when using private package repos (other than also registering every single private package name you use on pypi.org). Blows my mind.

Who is "they"? PyPI is an index; it doesn't control your installing client.

(This is a larger issue - or feature, depending on your perspective - with Python packaging. But it's important to understand that PyPI itself can't force `pip` or any other client to pick any particular resolution order between indices.)

Re: PyPI Blog: Project Quarantine

#18

the fact that `pip install` just runs whatever is in `setup.py` is still mind baffling, even if the author weren't mallicious the `setup.py` can still do harm (say delete a file by mistake), there really needs to be an official way of sandbox its running.

It's not good, but it should also not be baffling: it's the exact same thing other ecosystems do (npm with install hooks/scripts, Rust with build.rs, Ruby with gemspecs, etc).

Re: PyPI Blog: Project Quarantine

#19

the fact that `pip install` just runs whatever is in `setup.py` is still mind baffling, even if the author weren't mallicious the `setup.py` can still do harm (say delete a file by mistake), there really needs to be an official way of sandbox its running.

Note that it's possible to disable that behavior with `pip install --only-binary :all:`.

This way, pip will fail if a dependency does not provide a `.whl` package, instead of automatically falling back to the "build from source" mode that can lead to arbitrary code execution at install time (via setuptools' `setup.py` or any other build backend mechanism).

However, installing from wheels just protects from arbitrary code execution at install time. If you do not trust the source and integrity of the package you install, you would still be subject to arbitrary code execution at import time.

Therefore, tools and processes to improve package provenance tracing and integrity checking are useful for both kinds of installations.

Re: PyPI Blog: Project Quarantine

#20
Its always an interesting dynamic: assuming a high trust society pays dividends - Python would be nowhere close the success it has been without PyPI.

But then success attracts trust abusers and forces raising the fences (which comes with higher costs, both direct and indirect).

Direct costs in the people and infrastructure that must be dedicated to the task. Indirect costs in the frictions generated by complicating workflows.

It all points to the need for open source ecosystems to be taken more seriously by the economically able users who most benefit from this amazing development.

Post reply on HN