I think a proper way to solve this issue, not specific to python but languages running in a VM in general, would be to have some sort of language support where you specifically define what access rights/ system resources you allow for any given dependency. Example of defining project dependencies: { "apollo-client": { "version": "...", "access": ["fetch"] // only fetch allowed }, "stringutils": { "version": "...", "a…
Dozens of malicious PyPI packages discovered targeting developers
231–240 of 334 posts
Re: Dozens of malicious PyPI packages discovered targeting developers
#232Earlier quoted context omitted.
Another thing I think might help is (a) Discourage any future use of ">=" in version dependencies. Specify an exact version. That way a future compromised version doesn't get pulled (b) Every build system needs better ways of having multiple versions of a same dependency coexist. I should be able to have one of my project's dependencies depend on "numpy==1.15" and another dependency depend on "numpy==1.16" and they s…
Would you run into dynamic linker problems in this case due to symbol conflicts? Or does symbol versioning magically resolve that somehow?
foo() becomes v1_15_4_foo() automatically
Re: Dozens of malicious PyPI packages discovered targeting developers
#233Earlier quoted context omitted.
Doesn't this only apply to the entire process? Not the individual dependencies, right? Just confirming, Deno was my first thought with this, it requires the developer to deliberately enable permissions needed.
Yes, it applies to the whole process. It's incredibly hard to sandbox dependencies individually since you don't know how your code or other dependencies interact with it. If you want you can run dependencies in a worker process and sandbox that tighter, but that is quite a bit of work.
Re: Dozens of malicious PyPI packages discovered targeting developers
#234I think a proper way to solve this issue, not specific to python but languages running in a VM in general, would be to have some sort of language support where you specifically define what access rights/ system resources you allow for any given dependency. Example of defining project dependencies: { "apollo-client": { "version": "...", "access": ["fetch"] // only fetch allowed }, "stringutils": { "version": "...", "a…
Anyway I'll leave this from 2013 here:
> After having work during 3 years on a pysandbox project to sandbox untrusted code, I now reached a point where I am convinced that pysandbox is broken by design. Different developers tried to convinced me before that pysandbox design is unsafe, but I had to experience it myself to be convineced.
> It would also be nice to help developers looking for a sandbox for their application. Please tell me if you know sandbox projects for Python so I can redirect users of pysandbox to a safer solution. I already know PyPy sandbox.
-- https://mail.python.org/pipermail/python-dev/2013-November/1...
Re: Dozens of malicious PyPI packages discovered targeting developers
#235I think a proper way to solve this issue, not specific to python but languages running in a VM in general, would be to have some sort of language support where you specifically define what access rights/ system resources you allow for any given dependency. Example of defining project dependencies: { "apollo-client": { "version": "...", "access": ["fetch"] // only fetch allowed }, "stringutils": { "version": "...", "a…
This is essentially the fine-grained control the Java Security Manager enabled. But hardly anyone used it and it was deprecated sadly.
Re: Dozens of malicious PyPI packages discovered targeting developers
#236This is one reason I prefer Debian python packages.
Re: Dozens of malicious PyPI packages discovered targeting developers
#237can there be a "blue checkmark" system for pypi authors? I'm sure that's been brought up and rejected for reasons .
Identity verification will never be enough, if their account or anything in their development or distribution pipeline is compromised, so will their code. Sandboxing mechanisms are fundamentally required - not only to ward off malicious attacks there, but to prevent accidental side effects and compromise at runtime too.
the same argument can be applied to, "when you park on the street in manhattan, close your windows and lock your doors". Well that won't save your car from being compromised. But it will certainly make it way less likely that someone will steal something out of your car.
Re: Dozens of malicious PyPI packages discovered targeting developers
#238can there be a "blue checkmark" system for pypi authors? I'm sure that's been brought up and rejected for reasons .
SQLAlchemy can get one for $20/mo : - D
but IMO they'd never charge for such a thing, that's not at all in the spirit of OSS / python dev.
Re: Dozens of malicious PyPI packages discovered targeting developers
#239can there be a "blue checkmark" system for pypi authors? I'm sure that's been brought up and rejected for reasons .
I think the issue isn't so much malicious authors, it's compromised repositories and compromised repositories as dependencies. Blue check would gatekeep a lot of noble, new developers.
Re: Dozens of malicious PyPI packages discovered targeting developers
#240I wonder why we can’t have pip packages be published by username or organization, like pip install google/tensorflow It would significantly reduce the attack space
It gives false sense of security. What about google_official/tensorflow
Actually it should be not just a key but a whole TLS certificate, with references to a CA, activity dates, etc.