CVE-2023-38408: Remote Code Execution in OpenSSH’s forwarded ssh-agent
A remote code execution flaw existed in OpenSSH's forwarded ssh-agent, which caches private keys for authentication. A remote attacker could potentially execute arbitrary commands on a vulnerable forwarded ssh-agent, and the researchers verified a proof of concept on Ubuntu Desktop installations.
Qualys Threat Research Unit (TRU) Follow
Published on blog.qualys.com
The Qualys Threat Research Unit (TRU) has discovered a remote code execution vulnerability in OpenSSH’s forwarded ssh-agent. This vulnerability allows a remote attacker to potentially execute arbitrary commands on vulnerable OpenSSH’s forwarded ssh-agent.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a flaw in how the forwarded ssh-agent handles requests from a remote connection, allowing attacker-controlled input to reach code execution; the text does not state the precise mistake.
Impact
A remote attacker could potentially execute arbitrary commands on a vulnerable forwarded ssh-agent; the researchers verified a proof of concept on Ubuntu Desktop 22.04 and 21.10, and other Linux distributions are likely vulnerable.
What the attacker needed
Agent forwarding in use; remote access to the forwarded agent
The fix
OpenSSH prepared and released patches, and the advisory recommends applying them on priority.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The ssh-agent is a helper program that keeps your SSH keys unlocked in memory so you do not have to type your passphrase constantly. Agent forwarding lets a remote server use that helper through your own machine. The bug meant a remote attacker could abuse this forwarding to run their own commands on the machine holding the keys.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.