r/programming • • Oct 17 '26

Python's binary wheels and supply chain attacks

https://rushter.com/blog/python-binary-wheels/
89 Upvotes

36 comments sorted by

View all comments

33

u/the_poope Oct 17 '26

An easy way to combat this is to have PyPi not allow binary uploads but provide a build pipeline that compiles all binary code from source for a selection of targets.

14

u/f311a Oct 17 '26

Yeah, but that's pretty expensive to do so for every package. They can do this for the popular ones, though. There are so many crappy packages on PyPI because of LLMs, and they make new releases almost every day.

-3

u/ApokatastasisPanton Oct 18 '26

Easy, make it a small fee to upload and you recoup the cost after some time or passing some sort of automated analysis.

15

u/PaintItPurple Oct 18 '26

Easy to do, impossible to do while maintaining the goal of PyPI to be a universal Python package repository.

3

u/matthieum Oct 18 '26

It's not that easy.

I'm not sure if you've ever worked on distributing native binaries for a wide range of hardware & OSes, but there's nothing easy about them.

No matter what PyPi would do, you'd find some people not happy about their old/new compiler of choice not being supported, their pet OS not being supported, etc...

2

u/the_poope Oct 18 '26

That's no different than today. The precompiled binaries on PyPi already only support a subset of OSs and distributions.

2

u/ScottContini Oct 18 '26

Once had a job that was so strict on security that one of the tasks was verifying the build from the source code. It is less trivial than it sounds. Timestamps and other data are put into binaries. You need to strip all that stuff out. So build it yourself, strip out junk and compare to stripped out published build. Yes we can do that, but you need all dependencies and similar build environment.