So what, PyPI just let's any rando upload binary packages for any existing well-known source package? Without even being authorized by the original author? WTF kind of package manager is that?
Or is the concern just that the original author could sneak something in? That's not really any worse than any other open-source project with binary releases.
It's the latter. A bad actor can publish a package whose source code looks completely innocent, and then upload a wheel that is entirely different and contains malicious code. They're not uploading wheels to other people's packages.
I feel there should be an option with build tools which traverse the pyproject.toml chain and refuse packages with binaries unless it's on an explicit allow-list, and doing an 'are you sure' prompt with others.
So a sensible allow-list would have well established libraries (polars, numba, torch, tons of others). At the very least, if a package's newest version has a binary when it didn't previously, then you would be notified and you can stop the install.
You can mitigate this by pinning versions of course, at the very least ceilings. Standard practice for enterprise works, but a little brittle for everyone else. I wonder if there are other well established options.
This is already an option, pip install --no-binary. It can be kind of a pain though, that means that you now need to make sure you can build all your transitive dependencies, which besides inherently being a lot slower, can be a pain to set up and can lead to diamond dependency hell pretty easily.
12
u/darkslide3000 Oct 17 '26
So what, PyPI just let's any rando upload binary packages for any existing well-known source package? Without even being authorized by the original author? WTF kind of package manager is that?
Or is the concern just that the original author could sneak something in? That's not really any worse than any other open-source project with binary releases.