(no title)
sullivanmatt | 2 years ago
To be clear, the "remote" part of the code execution is that an attacker controlling your destination server can cause your client to run an attacker-controlled payload, if the client is forwarding their credentials (`ssh -A`). Most people don't tend to make connections to arbitrary SSH hosts, and certainly they don't do it while forwarding their credentials along.
It's a neat attack, and I applaud the Qualys team on their find, but this is not any sort of emergency situation for 99.99% of systems.
gunapologist99|2 years ago
Not only can it be exploited across a wide variety of clients across multiple platforms, but all that's required is that you're using key forwarding.
This is devastating, because it's not just that you control the destination server and steal the keys, but you can take over the user's entire workstation.
Once you've got the user's entire workstation, you potentially have access to everything else they have, from their email, to other SSH hosts, to key loggers, to Git repos. This is about as bad as it gets, and all because someone is using Agent Forwarding.
Best of all, the victim has no idea that they've been completely compromised. They can live inside your machine for years, upgrade their sploits, and generally exfiltrate all of your secrets.
Never use agent forwarding. Just don't. "Agent forwarding should be enabled with caution" in the man page is another massive understatement. Even if you think you need it, check the other responses in this thread for examples of how to work around it.
dumpsterdiver|2 years ago
Agreed. As this exploit proves, it's not even safe to log into your own servers using ssh forwarding if any service is exposed remotely, because if an attacker compromises that exposed service and gains root then they could extend the attack to your workstation, and that's a huge deal - especially considering that you have the private key to log into that server on your computer (so it's not an unsafe bet there might be other keys).
e12e|2 years ago
Just to add to this, with the new -J/ProxyJump directive, it's become (even) easier to login through a ssh host without needing to enable agent forwarding (Given that you're connecting through a not-ancient host running a reasonable version of openssh - beware of firewall/appliances stuck on ancient sshd and/or proprietary/"mini" versions).
pritambaral|2 years ago
I forward my agent by default because I've set it up securely. My setup is safe from this exploit too (I use gpg-agent as my SSH Agent). In return I get the seamless convenience I cannot get through any other method. Jump hosts are fine (and I use them too) but there is no way I'd be able to do remote git operations in ephemeral dev containers without the peace of mind (and safety) that agent forwarding gives me.
Creating keys on remote dev envs for git operations is _less_ secure than agent forwarding, even when those keys are encrypted (passphrase protected) at rest, because they have to be loaded into memory on the (potentially compromised) remote host.
justsomeadvice0|2 years ago
https://abyssdomain.expert/@filippo/109659699817863532
TBF this is a vulnerable config either way; but RCE on the client shouldn't be possible.
doubled112|2 years ago
Among the settings are explicitly disabling agent forwarding, and using a git specific identity (SSH key).
tinus_hn|2 years ago
TechBro8615|2 years ago
ivlad|2 years ago
franga2000|2 years ago
e28eta|2 years ago
jmalicki|2 years ago
If you root the bastion box, you have user credentials for anything inside the network. Controlling the user's laptop seems unlikely to be your most profitable next step.
akerl_|2 years ago
malux85|2 years ago
Pretty unlikely
Arnavion|2 years ago
sullivanmatt|2 years ago
But yes, your point stands. Huge number of preconditions here to fulfill.
paulmd|2 years ago
gunapologist99|2 years ago
nocsi|2 years ago