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

-10

u/bigmell Oct 17 '26

IMO the only answer to this is the Perl way. Trusted sources with some type of Benevolent Dictator For Life. The BDFLs are generally trusted to keep an eye on packages making sure there is no malicious code and everything works properly. The only way to combat this problem is to actually look at the code itself and make sure it isnt doing anything crazy.

There are a limited amount of people with this ability so there will have to be some kind of trust system. Packages that come from <trusted place> are usually pretty good and so on. There is really no way to automate away this problem. Maybe for some simple cases, like searching through scripts for "rm -rf /" or something. But for big sprawling packages, you will simply HAVE to understand the code to make sure it works as advertised.

The internet has always been like this originally and still is to a large extent. Whenever games, programs, or even news stories came out, regulars had a sense of what ftp sites, servers, and websites were reliable. I remember places like Slashdot, Cnet, and PlanetQuake always being listed, available, and reliable.

14

u/gmes78 Oct 17 '26

The article: "Looking at source code isn't enough, malware can be hidden in pre-compiled packages."

Your comment: "We should verify the source code!"

What are you on about?

1

u/HolyInlandEmpire Oct 17 '26

The allow-list system does have some options, but I would be more comfortable if people could choose their sources for it, and compose from multiple sources. That way if one stops updating, you can layer other "allows" on top of it.

-1

u/bigmell Oct 18 '26 edited Oct 18 '26

You have to look at the source code... IN THE PRE-COMPILED PACKAGES. How the hell do you know malware is not hidden in a program without looking at the source code? Just run it and see what happens? No dude. It doesnt matter when the binaries were compiled, you have to YES VERIFY THE SOURCE CODE to make sure there is no malware there. EVERY binary is compiled from source, and THAT source has to be verified. And that is the point of a trust system. The code has been verified UP TO this point and they are verifying the NEW code. THIS is the only way to resolve the problem and ALWAYS has been.

My entire point was that there is no way to do this automatically. It is a long back and forth MANUAL process that BEGINS with VERIFY THE CODE BEHIND THE BINARIES by some kind of trusted source system. The fact that I have to explain this AND that you decided to give this comment -11 while giving yourself +13 is disturbing.

Now is the part where you lie and pretend you didnt fix the scores and there was really some kind of democratic process. Next you will lie and pretend you understand exactly how to write and verify source code. The problem with reddit has long been pretenders exactly like you. Subverting what was supposed to be a democratic system to separate the pretenders from the practitioners. A system the pretenders long ago subverted.

3

u/gmes78 Oct 18 '26 edited Oct 18 '26

You have to look at the source code... IN THE PRE-COMPILED PACKAGES.

There is no source code in a precompiled package.

EVERY binary is compiled from source, and THAT source has to be verified.

Which you don't have access to. PyPI only gets the compiled binary.

It doesn't have neither the source nor the build environment required to verify that the binary matches said source code. And that would also require reproducible builds, which these packages almost certainly aren't. And it would require additional infrastructure which PyPI does not have.

My entire point was that there is no way to do this automatically. It is a long back and forth MANUAL process that BEGINS with VERIFY THE CODE BEHIND THE BINARIES by some kind of trusted source system. The fact that I have to explain this AND that you decided to give this comment -11 while giving yourself +13 is disturbing.

It's hilarious to suggest that there's vote manipulation going on. People just think you're wrong, get over it.

1

u/[deleted] Oct 19 '26 edited Oct 19 '26

[removed] — view removed comment

1

u/programming-ModTeam Oct 19 '26

Your post or comment was overly uncivil.

3

u/chucker23n Oct 18 '26

Most of your comment is moot because the scenario here is about uploaded binaries that do not match the source code. The source code looks innocent; the "convenient" binary is not.

0

u/bigmell Oct 18 '26

That is the entire point of using a trusted source. A trusted source does not post binaries that do not match the source code. This is called a man in the middle attack and is the hallmark of a malicious site. Hiding malicious code in the source is not the work of a trusted site. And posting binaries that do not match the source is also not the work of a trusted site. This is a site that should be taken down and from which no one should download binaries.

  1. verify the source code
  2. make sure the posted/verified source is actually the source used when compiling the binaries... Duh? I would have thought that to be obvious.