News for hackers. Stuff that matters.
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by stephc_int13 on Friday March 29, 2024 @06:41PM (#39869796)
I guess that rewriting liblzma in Rust would not have prevented this backdoor. But would have likely increased the confidence in its safety.

Using the build system (and potentially the compiler) to insert malicious backdoors is far from a new idea, and I don't see why this example would the only case.

Re:Backdoor in upstream xz/liblzma leading to SSH server com... by anonymous-panda on Friday March 29, 2024 @06:49PM (#39869869)
Don’t know all the details and rust isn’t immune to a build attack, but stuff like that tends to stand out a lot more I think in a build.rs than it would in some m4 automake soup.
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by minetest2048 on Friday March 29, 2024 @07:12PM (#39870061)
There was a drama back then where serde tried to ship its derive macro as a precompiled binary: https://news.ycombinator.com/item?id=37189462
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by yencabulator on Friday March 29, 2024 @07:04PM (#39869988)
The backdoor hinged on hiding things in large shell scripts, obscure C "optimizations", and sanitizer disabling. I'd expect all of those would be a much bigger red flag in the Rust world.
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by nullifidian on Friday March 29, 2024 @09:11PM (#39870864)
It would have made it worse, because there would be 300 crates with 250 different maintainers, all pulled in by several trivial/baseline dependencies. More dependencies = higher the probability that a malicious maintainer has gotten maintainer's rights for one of them, especially because many original authors/maintainers of rust style microdepencency crates move on with their lives and eventually seek to exit their maintainer role. At least for classic C/C++ software, by the virtue of it being very inconvenient to casually pull 300 dependencies for something trivial, there are fewer dependencies, i.e. separate projects/repos, and these tend to be more self-contained. There are also "unserious" distributions like Fedora and something like stable/testing/unstable pipeline in Debian, which help with catching the most egregious attempts. Crates.io and npm are unserious by their very design, which is focused on maximizing growth by eliminating as many "hindrances" as possible.
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by yogorenapan on Friday March 29, 2024 @11:57PM (#39871713)
Why is rust beginning to sound like JavaScript?
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by intelVISA on Saturday March 30, 2024 @02:42AM (#39872408)
Modern coders have been conditioned to import random libs to save 30mins work.
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by joshhansen on Sunday March 31, 2024 @03:24AM (#39882184)
Rust specifically chose a minimal standard library to not get stuck with the Python "dead batteries" problem. There's a strong culture as well of minimizing a project's dependencies in Rust.
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by account42 on Thursday April 04, 2024 @08:59AM (#39929845)
> Rust specifically chose a minimal standard library to not get stuck with the Python "dead batteries" problem.

So has C++ in the past although there seems to be a push for a more batteries included approach recently.

> There's a strong culture as well of minimizing a project's dependencies in Rust.

This doesn't match what anyone can observe by looking at dependencies of Rust projects.

Re:Backdoor in upstream xz/liblzma leading to SSH server com... by im3w1l on Saturday March 30, 2024 @06:12AM (#39873435)
This hack exploited a fairly unique quirk in the linux C ecosystem / culture. That packages are built from "tarballs" that are not exact copies of the git HEAD as they also contain generated scripts with arbitrary code.

It would not have happened in any modern language. It probably wouldn't have even happened in a Vistual Studio C-project for windows either.

Re:Backdoor in upstream xz/liblzma leading to SSH server com... by everybackdoor on Saturday March 30, 2024 @07:42AM (#39873911)
Funny you should say that, given they definitely have exploit code in `vcpkg`
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by Denvercoder9 on Saturday March 30, 2024 @09:32AM (#39874691)
> It would not have happened in any modern language.

It would. pip for example installs from tarballs uploaded to PyPi, not from a git repository.

Re:Backdoor in upstream xz/liblzma leading to SSH server com... by im3w1l on Saturday March 30, 2024 @04:47PM (#39878492)
Pip and similar are their own can of worms yeah. They trade convinience for an almost complete lack of oversight.

But in this case we are talking about people (distro packagers) manually downloading the source and building it which is not quite the same thing.

Re:Backdoor in upstream xz/liblzma leading to SSH server com... by Denvercoder9 on Saturday March 30, 2024 @04:53PM (#39878545)
`pip install` does do exactly the same thing: it downloads and executes code from a tarball uploaded to PyPi by its maintainer. There's no verification process that ensures that tarball matches what's in the git repository.
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by im3w1l on Saturday March 30, 2024 @09:01PM (#39880325)
Yes I know, and that's what I meant when I said "their own can of worms".

Distro-provided python packages don't use pip however, at least afaik.

Re:Backdoor in upstream xz/liblzma leading to SSH server com... by Denvercoder9 on Saturday March 30, 2024 @09:30PM (#39880506)
The distro-provided Python packages are usually still build from the source on PyPi as uploaded by the maintainer, not what's in git.
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by joshhansen on Sunday March 31, 2024 @03:23AM (#39882176)
If it were using Cargo as its build system, it might make such manipulations more obvious / understandable?