I'm watching some folks reverse engineer the xz backdoor, sharing some *preliminary* analysis with permission.
The hooked RSA_public_decrypt verifies a signature on the server's host key by a fixed Ed448 key, and then passes a payload to system().
It's RCE, not auth bypass, and gated/unreplayable.
The hooked RSA_public_decrypt verifies a signature on the server's host key by a fixed Ed448 key, and then passes a payload to system().
It's RCE, not auth bypass, and gated/unreplayable.
Reposted from
Filippo Valsorda
This might be the best executed supply chain attack we've seen described in the open, and it's a nightmare scenario: malicious, competent, authorized upstream in a widely used library.
Looks like this got caught by chance. Wonder how long it would have taken otherwise.
Looks like this got caught by chance. Wonder how long it would have taken otherwise.
Comments
(Why "decrypt"? RSA sig verification is the same op of RSA encryption. 🤷♂️)
OpenSSH certs are weird in that they include the signer's public key. OpenSSH checks the signature on parsing. https://github.com/openssh/openssh-portable/blob/281ea25a44bff53eefb4af7bab7aa670b1f8b6b2/PROTOCOL.certkeys#L207-L219
https://gist.github.com/keeganryan/a6c22e1045e67c17e88a606dfdf95ae4
Unfortunately, this means that unless a bug is found, we can't write a reliable/reusable over-the-network scanner.
So sort of definition, what is called "decrypt" and "encrypt"
Decrypt a message only intended for the recipient, which may be encrypted by anyone having the public key
Encrypt a message which may be decrypted by anyone, but which can only be encrypted by one person; this provides a digital signature.
struct rsa_meth_st
{
const char *name;
int (*rsa_pub_enc)(...);
int (*rsa_pub_dec)(...);
int (*rsa_priv_enc)(...);
int (*rsa_priv_dec)(...);
...
IOW, are people that had compromised versions, but whose sshd was either not running or behind a firewall guaranteed to be safe and not further compromised?
- most servers likely run stable versions that weren't compromised
- most laptops have no sshd or at least no open one
Maybe, though, the adversary wanted to keep this very low profile.
In any case, please keep us informed if there should be any new findings or confirmations, on whether people can feel safe :-)
Thanks!
😁