Re:Remote Code Execution in OpenSSH’s forwarded SSH-agent
by gunapologist99 on Wednesday July 19, 2023 @04:28PM
(#36792732)
Just generate a new keypair there on your bounce box then. Don't do -A because this RCE means that not only do you lose your keys, but you lose your laptop, too!
Re:Remote Code Execution in OpenSSH’s forwarded SSH-agent
by lxgr on Wednesday July 19, 2023 @07:02PM
(#36794721)
What if you don’t trust the box enough to store a private key, though?
Re:Remote Code Execution in OpenSSH’s forwarded SSH-agent
by themoonisachees on Thursday July 20, 2023 @05:28AM
(#36798417)
A box you can't trust to hold your keys could just as easily put a ssh -A command in your bashrc and use your agent to perform stuff on any servers your key is accepted on.
Re:Remote Code Execution in OpenSSH’s forwarded SSH-agent
by pritambaral on Thursday July 20, 2023 @09:22AM
(#36800053)
Not if your agent supports and is configured to confirm each use. See ssh-add -c.
Re:Remote Code Execution in OpenSSH’s forwarded SSH-agent
by aidenn0 on Wednesday July 19, 2023 @04:56PM
(#36793227)
It's not limited to star topologies; You can use ProxyJump for any topology that includes fixed routes from a client to a host. Just add a separate host entry for each machine.
4 server example (this assumes your client can connect to only host C) with the following topology:
C -> B -> A
\-> D
ssh configuration snippet: Host A
ProxyJump B
Host B
ProxyJump C
Host D
ProxyJump C
This example is a tree-like topolgy, but you can use host aliases (i.e. add a HostName that is different from the host entry) to define any fixed route to any machine you like.
Re:Remote Code Execution in OpenSSH’s forwarded SSH-agent
by saltcured on Wednesday July 19, 2023 @06:52PM
(#36794629)
For me, the main use of agent-forwarding is that I need to use a command that expects to use SSH to get between leaf nodes. For example git or rsync CLIs that need to manipulate the local filesystem and tunnel their own protocol over SSH to talk to another remote server.
At times, I've wished for something like uMatrix but for ssh-agent forwarding, so I could have policies for which peer-to-peer authentications should be allowed for which keys and whether these specific uses should require interactive confirmation.
Edit: Nevermind, tried it, not sufficient for my use case.
I tend to do a lot of mesh-y bouncing around between servers, and -J seems to be more intended for a star/hub&spoke topology. Common ssh priv-key to all machines, or alternatively, a unique set of priv_keys per user per dest machine is about the way to go. You still have privilege escalations to worry about, but thems the breaks.
It's a neat trick, I'll give it that.