3 ms·
I've noted similar vulnerabilities in every common package management system, including NuGet, Cargo, and NPM. There are giant gaps in security a truck could be
by jiggawatts 3y ago
I've noted similar vulnerabilities in every common package management system, including NuGet, Cargo, and NPM. There are giant gaps in security a truck could be driven through.
Collectively, we must start taking the "bill of materials" that goes into our software much more seriously, including the chain of custody from source to binary.
Start with linking each package directly to the Git commit hash it came from.
Then a good start would be enforced reproducible builds. Don't trust the uploader to package their code. Run this step in the package management system from the provided source hash.
Pure functional build systems would be a heck of a lot better, with no side effects of any kind permitted. No arbitrary scripts or arbitrary code during build. No file reads, network access, or API calls of any kind outside of the compiler toolkit itself.
Then, I would like to see packages go through specially instrumented compilers that generate an "ingredient label" for each package. Transitive dependencies. Uses of unsafe constructs in otherwise safe languages. Lists of system calls used. Etc...
You're about to say that clever hackers can work around that by using dynamic calling, or call-by-name, or some other clever trick.
Sure, that's possible, but then the system can report that. If some random image codec or compression library uses any platform API at all, then it's instantly suspect. These things should be as pure as the driven snow: Bytes in, decoded data out.
- bandrami 3y ago> outside of the compiler toolkit itself Which toolchain includes, unfortunately, xz
- pabs3 3y agoYou can avoid that by bootstrapping the compiler and everything else from scratch. See bootstrappable.org and GNU Guix, which starts at a few hundred bytes of machine code and goes up to a full distro. https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/ https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-...
- bandrami 3y agoIIRC that first GUIX build is at least theoretically the first Unix-like OS that was not rooted by Ken Thompson.