Live data from Hacker News

Backdoor in upstream xz/liblzma leading to SSH server compromise

openwall.com

851–860 of 1001 posts

Re: Backdoor in upstream xz/liblzma leading to SSH server compromise

#851
post #775
post #514

Earlier quoted context omitted.

GitHub has suspended @JiaT75's account. EDIT: Lasse Collin's account @Larhzu has also been suspended. EDIT: Github has disabled all Tukaani repositories, including downloads from the releases page. -- EDIT: Just did a bit of poking. xz-embedded was touched by Jia as well and it appears to be used in the linux kernel. I did quick look and it doesn't appear Jia touched anything of interest in there. I also checked the…

> EDIT: Github has disabled all Tukaani repositories, including downloads from the releases page. Why? Isn't it better to freeze them and let as many people as possible analyze the code?

You can find it on archive. Someone archived it last night

Re: Backdoor in upstream xz/liblzma leading to SSH server compromise

#852
post #79

Earlier quoted context omitted.

I've analysed the backdoor myself and it's very sophisticated, not poorly made at all. The performance problem is surprising in this context, but I think next time they won't make that mistake.

Do you have a writeup or any details as to what it does? The logical thing based on this post is that it hooks the SSH key verification mechanism to silently allow some attacker-controlled keys but I wonder if there's more to it?

sshd starts with root privileges and then proceeds to, in summary:[1]

1. Parse command line arguments

2. Setup logging

3. Load configuration files

4. Load keys/certificates into memory (notably including private keys)

5. Listen on a socket/port for incoming connections

6. Spawn a child process with reduced permissions (on Linux, using seccomp filters [2]) to respond to each incoming connection request

This backdoor executes at order 0 before sshd's main function is invoked, overwriting internal sshd functions with compromised ones. As some ideas of what the backdoor could achieve:

1. Leak server private keys during handshakes with users (including unauthenticated users) allowing the keys to be passively stolen

2. Accept backdoor keys as legitimate credentials

3. Compromise random number generation to disable perfect forward secrecy

4. Execute code on the host (supplied remotely by a malicious user) with the 'root' permissions available to sshd upon launch. On most Linux distributions, systemd-analyze security sshd.service will give a woeful score of 9.6/10 (10 being the worst).[3] There is essentially NO sandboxing used because an assumption is made that you'd want to login as root with sshd (or sudo/su to root) and thus would not want to be restricted in what filesystem paths and system calls your remote shell can then invoke.

The same attacker has also added code to Linux kernel build scripts which causes xz to be executed (xz at this point has a backdoor compiled into it) during the build of the Linux kernel where xz compression is used for the resulting image. Using this approach, the attacker can selectively choose to modify certain (or all) Linux kernel builds to do some very nasty things:

1. Leak Wireguard keys allowing them to be passively intercepted.

2. Compromise random number generation, meaning keys may be generated with minimal entropy (see Debian certificate problem from a few years ago).

3. Write LUKS master keys (keys used by dm-crypt for actually decrypting disks) to disks in retrievable format.

4, Introduce remote root code execution vulnerabilities into basic networking features such as TCP/IP code paths.

[1] 'main' function: https://anongit.mindrot.org/openssh.git/tree/sshd.c

[2] https://anongit.mindrot.org/openssh.git/tree/sandbox-seccomp...

[3] https://github.com/gentoo/gentoo/blob/HEAD/net-misc/openssh/...

Re: Backdoor in upstream xz/liblzma leading to SSH server compromise

#856
post #710

I hope Lasse Collin is doing OK! Here is a older message from him [1] "I haven't lost interest but my ability to care has been fairly limited mostly due to longterm mental health issues but also due to some other things. Recently I've worked off-list a bit with Jia Tan on XZ Utils and perhaps he will have a bigger role in the future, we'll see. It's also good to keep in mind that this is an unpaid hobby project. " Gi…

He came on IRC, he seemed ok. He did some cleanup of access and signed off for easter.

I mean, he was right at least. Jia Tan did have a bigger role.

Re: Backdoor in upstream xz/liblzma leading to SSH server compromise

#858
post #67

Earlier quoted context omitted.

Wow, that's a lot of anonymous accounts adding comments there urging for a fast merge! And this "Hans Jansen" guy is apparently running around salsa.debian.org pushing for more updates in other projects as well: https://salsa.debian.org/users/hjansen/activity

And now we see why I don't trust anons, aliases, or anime characters to make contributions. My GitHub says exactly who I am!

Even if they have a "real" picture or a credible description that is not good enough. Instead of using an anime character a malicious actor could use an image generator [0], they could generate a few images, obtain something credible to most folks, and use that to get a few fake identities going. Sadly, trusting people to be the real thing and not a fake identity on the Internet is difficult now and it will get worse.

[0] https://thispersondoesnotexist.com

Re: Backdoor in upstream xz/liblzma leading to SSH server compromise

#859
post #602
post #514

Earlier quoted context omitted.

GitHub has suspended @JiaT75's account. EDIT: Lasse Collin's account @Larhzu has also been suspended. EDIT: Github has disabled all Tukaani repositories, including downloads from the releases page. -- EDIT: Just did a bit of poking. xz-embedded was touched by Jia as well and it appears to be used in the linux kernel. I did quick look and it doesn't appear Jia touched anything of interest in there. I also checked the…

Just for posterity since I can no longer edit: Libera staff has been firm and unrelenting in their position not to disclose anything whatsoever about the account. I obtained the last point on my own. Libera has made it clear they will not budge on this topic, which I applaud and respect. They were not involved whatsoever in ascertaining a VPN was used, and since that fact makes anything else about the connection info…

[flagged]

Re: Backdoor in upstream xz/liblzma leading to SSH server compromise

#860

Imagine a more competent backdoor attempt on xz(1)—one that wouldn't have been noticed this quickly. xz is everywhere. They could pull off a "reflections on trusting trust": an xz which selectively modifies a tiny subset of the files it sees, like .tar.xz software tarballs underlying certain build processes. Not source code tarballs (someone might notice)—tarballs distributing pre-compiled binaries. edit to add: Arch…

deb packages are xz compressed...

... and Debian is very serious about it: https://fulda.social/@Ganneff/112184975950858403
Post reply on HN