The main issue is the handling of security updates within the Nixpkgs ecosystem, which relies on Nix’s CI system, Hydra, to test and build packages. Due to the extensive number of packages in the Nixpkgs repository, the process can be slow, causing delays in the release of updates. As an example, the updated xz 5.4.6 package took nearly 5 days to become available in the unstable branch!

Fundamentally, there needs to be a change in how security fixes are handled in Hydra. As stated in the article, Nix was lucky to be unaffected, but multiple days to push out a security patch of this severity is concerning, even if there was no reason for concern.

28 points
*

Kinda tired of the constant flow of endless “analysis” of xz at this point.
There’s no real good solution to “upstream gets owned by evil nation state maintainer” - especially when they run it in multi-year op.

It simply doesn’t matter what downstream does if the upstream build systems get owned without anyone noticing. We’re fucked.

Debian’s build chroots were running Sid - so they stopped it all. They analyzed and there was some work done with reproducible builds (which is a good idea for distro maintainers). Pushing out security updates when you don’t trust your build system is silly. Yeah, fast security updates are nice, but it took multiple days to reverse the exploit, this wasn’t easy.

Bottom line, don’t run bleeding edge distros in prod.

We got very lucky with xz. We might not be as lucky with the next one (or the ones in the past).

permalink
report
reply
12 points

I think the post was more about pointing out how long it takes to put out a security patch. Security patches can also occur on stable.

permalink
report
parent
reply
2 points

Yeah, I can get that. The xv situation probably wasn’t the best of examples though?

permalink
report
parent
reply
5 points

We might not be as lucky with the next one (or the ones in the past).

Or the ones in the present, for what that’s worth

permalink
report
parent
reply
2 points

Maybe you should actually have read OP’s post.

permalink
report
parent
reply
5 points
*

I’m not sure why you think I didn’t? Sorry if it was unclear.

From the blog:

This incident has really made me wonder if running the unstable branch is a great idea or not.

My comment:

Bottom line, don’t run bleeding edge distros in prod.

Hope this clarified my opinion! Have a good day!

permalink
report
parent
reply
1 point

Bottom line, don’t run bleeding edge distros in prod.

This. My company’s servers are all Debian stable. Not even sweating the issue.

permalink
report
parent
reply
26 points

Were systems in the stable branch at risk of compromise? Were there delays in releasing security fixes in the stable branch.

permalink
report
reply
13 points

I don’t even think unstable was suseptical to it. I don’t think Nix ties ssh to systemd. Debian and redhat do.

permalink
report
parent
reply
12 points
*

It was not vulnerable to this particular attack because the attack didn’t specifically target Nixpkgs. It could have very well done so if they had wanted to.

permalink
report
parent
reply
4 points

Anyway the xz backdoor was enabled only in rpm and deb packages.

permalink
report
parent
reply
1 point

AFAIK it was enabled in anything that used the official source tarball. The exploit binaries were added during the tarball build process.

permalink
report
parent
reply
3 points
*

Shouldn’t the lesson here be “don’t introduce more complexity and dependencies to critical software”?

But then again that’s systemd in a nutshell…

permalink
report
parent
reply
5 points

AFAIK, affected versions never made it to stable as there was no reason to backport it.

permalink
report
parent
reply
24 points

This blog post misses entirely that this has nothing to do with the unstable channel. It just happened to only affect unstable this time because it gets updates first. If we had found out about the xz backdoor two months later (totally possible; we were really lucky this time), this would have affected a stable channel in exactly the same way. (It’d be slightly worse actually because that’d be a potentially breaking change too but I digress.)

I see two way to “fix” this:

  • Throw a shitton of money at builders. I could see this getting staging-next rebuild times down to just 1-2 days which I’d say is almost acceptable. This could even be a temporary thing to reduce cost; quickly renting an extremely large on-demand fleet from some cloud provider for a day whenever a critical world rebuild needs to be done which shouldn’t be too often.
  • Implement pure grafting for important security patches through a second overlay-like mechanism.
permalink
report
reply
20 points

Isn’t that the risk of running an unstable build of anything?

permalink
report
reply
7 points

This has nothing to do with “unstable” or the specific channel. It could have happened on the stable channel too; depending on the timing.

permalink
report
parent
reply
18 points
*
  • You’re using the unstable channel.

  • You could literally build it on your own, or patch your own change without having to wait - all you have to do is update the SHA256 hash and the tag/commit hash.

  • You can use slightly older official channels, as well as patched unofficial channels.

  • You can go back to using older binary, while running GC on suspected, newer malware binary, assuming that it hasn’t been executed yet.

If you’re not using Nix the way it is intended to be, it is on you. Your over-reliance on Hydra is not the fault of Nix in any way.

permalink
report
reply
37 points
*

First of all, I’m not the author of the article, so you’re barking up the wrong tree.

You’re using the unstable channel.

That doesn’t matter in the big scheme of things - it doesn’t solve the fundamental issue of slow security updates.

You could literally build it on your own, or patch your own change without having to wait - all you have to do is update the SHA256 hash and the tag/commit hash.

Do you seriously expect people to do that every time there’s a security update? Especially considering how large the ecosystem is? And what if someone wasn’t aware of the issue, do you really expect people to be across every single vulnerability across the hundreds or thousands of OSS projects that may be tied to the packages you’ve got on your machine?

The rest of your points also assume that the older packages don’t have a vulnerability. The point of this post isn’t really about the xz backdoor, but to highlight the issue of slow security updates.

If you’re not using Nix the way it is intended to be, it is on you. Your over-reliance on Hydra is not the fault of Nix in any way.

Citation needed. I’ve never seen the Nix developers state that in any official capacity.

permalink
report
parent
reply
2 points

After thinking a lot, your stance does make sense. However, it is not for the points you’ve raised in your defense - they’re not strong reasons that support Nix’s flaw, if we are talking about a generic trojan. The store-based file hierarchy would serve as a sort of defense, however, it isn’t a fool proof security.

However, if its solely targeted keeping Nix in mind, then yes, it’s a pile of stinking mess, with how the entire nixpkg file is filled with diff files. Diff files are not only difficult to read, it is also very easy to inject code without anyone finding out. It’s a ticking bomb waiting to explode.

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 8.9K

    Monthly active users

  • 5.6K

    Posts

  • 154K

    Comments