News for hackers. Stuff that matters.
Re:XZ backdoor: "It's RCE, not auth bypass, and gated/unrepl... by skywhopper on Saturday March 30, 2024 @06:07PM (#39879135)
From what I’ve read I think the attack vector is:

1. sshd starts and loads the libsystemd library which loads the XZ library which contains the hack

2. The XZ library injects its own versions of functions in openssl that verify RSA signatures

3. When someone logs into SSH and presents a signed SSH certificate as authentication, those hacked functions are called

4. The certificate, in turn, can contain arbitrary data that in a normal login process would include assertions about username or role that would be used to determine if the certificate is valid for use logging in as the particular user. But if the hacked functions detect that the certificate was signed by a specific attacker key, they take some subfield of the certificate and execute it as a command on the system in the sshd context (ie, as the root user).

Unfortunately, we don’t know the attacker’s signing key, just the public key the hacked code uses to validate it. But basically this would give the attacker a way to run any command as root on any compromised system without leaving much of a trace, beyond the (presumably failed) login attempt, which any system on the internet will be getting a lot of anyway.

Re:XZ backdoor: "It's RCE, not auth bypass, and gated/unrepl... by ghostpepper on Saturday March 30, 2024 @06:43PM (#39879402)
> beyond the (presumably failed) login attempt

There is some evidence it's scrubbing logs so we might not even have that.

Re:XZ backdoor: "It's RCE, not auth bypass, and gated/unrepl... by Deathcrow on Sunday March 31, 2024 @02:13AM (#39881865)
Is there really a failed login attempts? If it never calls the real functions of ssh in case of their own cert+payload why would sshd log anything or even register a login attempt? Or does the backdoor function hook in after sshd already logged stuff?
Re:XZ backdoor: "It's RCE, not auth bypass, and gated/unrepl... by numpad0 on Sunday March 31, 2024 @02:43AM (#39881988)
Depending on log level, isn't there going to be lines up to receiving the payload?
Re:XZ backdoor: "It's RCE, not auth bypass, and gated/unrepl... by skywhopper on Sunday March 31, 2024 @05:43AM (#39882787)
I think it would depend on logging level, yeah. I’ve not seen one way or another whether it aborts the login process or prevents logging, but that’s possible, and would obviously be a good idea. Then the question would be if you could detect the difference between a vulnerability-aborted login attempt and just a malformed/interrupted login attempt.

But in the case of this specific attack, probably the safest approach would be to watch and track what processes are being spawned by sshd. Which in retrospect is probably advisable for any network daemon. (Of course, lots of them will be sloppy and messy with how they interact with the system and it might be next to impossible to tell attacks from “legit” behavior. But sshd is probably easier to pin down to what’s “safe” or not.

Re:XZ backdoor: "It's RCE, not auth bypass, and gated/unrepl... by xinayder on Sunday March 31, 2024 @05:08AM (#39882648)
> When someone logs into SSH and presents a signed SSH certificate as authentication, those hacked functions are called

So if I only use pubkey auth and ED25519, there's no risk?

Besides this, just to understand it better, if someone tries to login to your server with the attacker's certificate, the backdoor will disable any checks for it and allow the remote user to login as root (or any other arbitrary user) even if root login is disabled in sshd config?

Re:XZ backdoor: "It's RCE, not auth bypass, and gated/unrepl... by skywhopper on Sunday March 31, 2024 @05:37AM (#39882771)
I don’t think we know enough to be sure even disabling certificate auth would prevent this. But from what I can tell it probably wouldn’t directly allow arbitrary user login. It only seems to allow the execution of an arbitrary command. But of course that command might do something that would break any other security on the system.

But, one clever thing about this attack is that the commands being run wouldn’t be caught by typical user-login tracking, since there’s no “login”. The attacker is just tricking sshd into running a command.

Re:XZ backdoor: "It's RCE, not auth bypass, and gated/unrepl... by jvans on Sunday March 31, 2024 @09:45AM (#39884200)
So is the implication here that any system that allows SSH and contains this malicious code is vulnerable?
Re:XZ backdoor: "It's RCE, not auth bypass, and gated/unrepl... by MuffinFlavored on Monday April 01, 2024 @01:55PM (#39896980)
> 2. The XZ library injects its own versions of functions in openssl that verify RSA signatures

Specifically how did the xz library patch/hook/inject into the openssl functions that verify RSA signatures?