News for hackers. Stuff that matters.
Re:GitHub Disabled the Xz Repo by 1attice on Saturday March 30, 2024 @12:43AM (#39871884)
Well, there goes `nixos-unstable`
Re:GitHub Disabled the Xz Repo by anotherhue on Saturday March 30, 2024 @12:57AM (#39871952)
> openssh does not directly use liblzma. However debian and several other distributions patch openssh to support systemd notification, and libsystemd does depend on lzma.[0]

A quick glance at nixpkgs[1] does not show a direct dependency.

0: https://www.openwall.com/lists/oss-security/2024/03/29/4

1: https://github.com/NixOS/nixpkgs/tree/master/pkgs/tools/netw...

Re:GitHub Disabled the Xz Repo by o11c on Saturday March 30, 2024 @01:04AM (#39871981)
It depends on PAM which might pull it in though.
Re:GitHub Disabled the Xz Repo by 1attice on Saturday March 30, 2024 @01:00AM (#39871964)
True, but irrelevant -- _some packages_, _somewhere_, do depend on xz, which, if built, requires pulling the source from GitHub (see the default.nix: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/to...)

It's not the vulnerability that's a problem right now (NixOS was protected by a couple of factors) but rather GitHub's hamfisted response.

That is the problem.

Re:GitHub Disabled the Xz Repo by dave_universetf on Saturday March 30, 2024 @01:05AM (#39871985)
It's not a problem, never has been. Nix mirrors all source bundles it pulls from third parties and caches them. cache.nixos.org has a copy of all the sources needed to build not just current HEAD, but also past commits (although deep history might start getting pruned for cost control soon, iiuc).

The Software Heritage archive also has an up to date mirror of xz's repo: https://archive.softwareheritage.org/browse/origin/directory...

Re:GitHub Disabled the Xz Repo by ndriscoll on Saturday March 30, 2024 @01:38AM (#39872134)
Are they storing source archives for each version? I'd think mirroring the actual repo might take less space than a bunch of copies of source archives.

Though it looks like git only uses deflate on pack files. Someone should write a patch to add lzma support. :-)

Re:GitHub Disabled the Xz Repo by dwattttt on Saturday March 30, 2024 @01:10AM (#39872002)
In this instance then, it sounds like it has cached the source with a backdoor in it, and anyone using it is potentially exposing themselves to a very public problem right now.
Re:GitHub Disabled the Xz Repo by dave_universetf on Saturday March 30, 2024 @01:17AM (#39872036)
Also no. It was rolled back hours ago, and cache.nixos.org keeps all past builds so it didn't even need rebuilding.

Orthogonal to that, the backdoor was irrelevant to nix in at least three different ways: the malicious build logic targeted rpm/deb build environments and so didn't trigger in nix's build sandbox, the backdoor code makes assumptions about filesystem layout that are invalid on nixos and so wouldn't have activated anyway, and nix doesn't include the downstream patch that results in the backdoor even getting into sshd's address space. Still got rolled back out of an abundance of caution, but nix got lucky that the attacker didn't bother targeting it the way they did debian and rpm-based distros.

Re:GitHub Disabled the Xz Repo by Timshel on Saturday March 30, 2024 @04:46AM (#39873001)
The issue is that the author had been contributing for 2 years.

Debian is considering reverting prior to his involment or switching, cf: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068024

Re:GitHub Disabled the Xz Repo by seba_dos1 on Saturday March 30, 2024 @06:40AM (#39873561)
They do that out of caution, not because that's what needs to be done. No reason to panic if your distro doesn't go as far.
Re:GitHub Disabled the Xz Repo by anotherhue on Saturday March 30, 2024 @01:07AM (#39871992)
Sure, but 'my updates are broken' is a happier (and more familiar to nixos-unstable users) place to be in than 'my ssh access has been compromised for days'.

Confirming no lzma linking on my recent x86_64 system: https://pastebin.com/hgN0LTxd

Re:GitHub Disabled the Xz Repo by 1attice on Saturday March 30, 2024 @01:14AM (#39872027)
yes, true, but also offtopic? Why are you bringing this up? This feels like 'anchoring' to me https://en.wikipedia.org/wiki/Anchoring_effect
Re:GitHub Disabled the Xz Repo by gertop on Saturday March 30, 2024 @01:06AM (#39871989)
I find it amusing that you choose to blame GitHub and not nix's brittle design. (can you imagine any other OS breaking because a repository goes down?)
Re:GitHub Disabled the Xz Repo by anotherhue on Saturday March 30, 2024 @01:10AM (#39872003)
NPM called...

Anyway, it's called unstable for a reason. Despite debian trying to change the meaning of the term :)

Re:GitHub Disabled the Xz Repo by nextaccountic on Saturday March 30, 2024 @12:46AM (#39871904)
Pulling directly from github is probably not a good thing either way. Maybe nixos should have its own mirror. Or maybe there should be an ipfs mirror that some distros and other projects could seed

Anyway I think that a new release that fixes the known vuln isn't enough. There should be a release without all contributions from the malicious dude

Re:GitHub Disabled the Xz Repo by rurban on Saturday March 30, 2024 @01:35AM (#39872124)
Pulling directly from github is the good thing. The release tar was compromised, the sources not.
Re:GitHub Disabled the Xz Repo by nextaccountic on Saturday March 30, 2024 @05:13AM (#39873156)
In this specific case this is true, but generally speaking Github can remove repositories for any reason (and for no reason). They provide free bandwidth so it gets used for that, it's just not trustworthy.

One option for distros that compile from source (such as Gentoo, NixOS without the package cache, of Arch Linux's AUR) is to make the package system to either download from Github, or download from a distro-provided mirror if Github is down. Distros could pool together to offer a source code mirror that is common for all their users. That would be a good thing.

Re:GitHub Disabled the Xz Repo by 1attice on Saturday March 30, 2024 @12:47AM (#39871908)
Less puckishly: in general, as a movement/culture/economic ferment, we probably should have been more hesitant to introduce a de-facto single-point-of-failure into, like, all the things.

I mean, nothing _mandates_ that NixOS packages pull their source from github (or any other git hoster) but the standard practice is basically just this.

The nix cache will prevent the impact from this specific disablement from being, well, disabling, for most folks most of the time, for a while at least, but caching, by definition, is ephemeral storage, and sooner or later, it, ah, ephemes? Is that a word?

There are also a lot of packages that have to be built locally, e.g. nonfree packages like nvidia drivers; at least _one_ of these packages (how popular? how critical?) will probably fail to build on this account, and this in turn will cause a certain (unknown) quotient of misery. Somewhere, some lights are going out. (How many? How soon? With what mitigation?)

Anyway. Nix is obviously not the only product to rely on github as a de facto backing store, so

Re:GitHub Disabled the Xz Repo by anon25783 on Saturday March 30, 2024 @12:50AM (#39871915)
Yes! There are alternatives to Github, people! Diversify! Switch to Sourcehut or Gitea or Gitlab or even DIY with Gitolite. git is a decentralized peer-to-peer system, we shouldn't let Microsoft have a monopoly on its use.
Re:GitHub Disabled the Xz Repo by Dylan16807 on Saturday March 30, 2024 @12:58AM (#39871954)
That works if you have multiple mirrors configured for each package.

Just adding variety reduces the chance of having all the important repos up at the same time.

Re:GitHub Disabled the Xz Repo by 1attice on Saturday March 30, 2024 @01:12AM (#39872013)
> Just adding variety reduces the chance of having all the important repos up at the same time.

this, sadly, is correct, and the solution you propose is also correct.

The only other option would be for the NixOS Foundation to mirror the git repo of _every single important package_, and I know they're already struggling with the prohibitive cloud costs of hosting just the build objects. :/

Re:GitHub Disabled the Xz Repo by kelnos on Saturday March 30, 2024 @01:50AM (#39872188)
They could mirror them on gitlab.com if they wanted to. It wouldn't even be that difficult to set up and automate.
Re:GitHub Disabled the Xz Repo by sunshowers on Saturday March 30, 2024 @01:07AM (#39871994)
I think this attitude really underrates the network effects of GitHub.

I personally am okay making an account on another forge to submit a bug report or patch, but most people aren't. And so I keep my repos on GitHub.

I do plan to soon set up mirroring to another service though. I haven't found a great zero-effort solution to mirror repos from an entire organization though, including ones that are created after mirroring was initially set up. Do you know of any tools which have that functionality? (If not I might write my own at some point.)

Re:GitHub Disabled the Xz Repo by Repulsion9513 on Saturday March 30, 2024 @01:13AM (#39872022)
You shouldn't need to make an account to report a bug, honestly.
Re:GitHub Disabled the Xz Repo by xyzzy123 on Saturday March 30, 2024 @01:29AM (#39872100)
Issue spam & harassment become a problem at scale.
Re:GitHub Disabled the Xz Repo by anon25783 on Saturday March 30, 2024 @02:11PM (#39877184)
You could host bug tracking separately from git, with Bugzilla perhaps?
Re:GitHub Disabled the Xz Repo by sunshowers on Saturday March 30, 2024 @05:30PM (#39878860)
(a) I spent many years on the Mozilla bugzilla, and it's far too complicated

(b) you still have to create an account there

Re:GitHub Disabled the Xz Repo by orbital-decay on Saturday March 30, 2024 @01:53AM (#39872200)
Great, now you have many points of failure spread over different hosters. The basic fact they're SPFs haven't changed.