Microsoft OpenSSH for Windows Remote Code Execution Vulnerability (CVE-2024-38029)
Microsoft OpenSSH for Windows allowed a malicious SSH server to load a DLL onto a connecting client when the ssh-agent service was started with the -Oallow-remote-pkcs11 option. An attacker controlling the server could then execute code on the victim's machine.
FAQ
According to the CVSS metric, the attack complexity is high (AC:H). What does that mean for this vulnerability? Successful exploitation of this vulnerability requires multiple conditions to be met, such as specific application behavior, user actions, manipulation of parameters passed to a function, and impersonation of an integrity level token.
FAQ
According to the CVSS metric, user interaction is required (UI:R). What interaction would the user have to do? Exploitation of this vulnerability requires a user to remote into a server that is controlled by an attacker, which could then allow the server to execute a command on the user's machine without their consent. This scenario assumes that the user has the ability to remote into the server and that the server has been compromised to execute such commands upon connection.
FAQ
How could an attacker exploit this vulnerability? An attacker could remotely load a malicious DLL onto a machine where the ssh-agent service is launched with the -Oallow-remote-pkcs11 option, which could lead to remote code execution. This vulnerability arises because the ssh-pkcs11-helper.exe is configured to allow remote DLL loading, which is not intended for arbitrary remote libraries but rather for pkcs providers already present on the remote machine.
FAQ
According to the CVSS metric, the attack vector is network (AV:N) and the user interaction is required (UI:R). What is the target context of the remote code execution? This attack requires a client to connect to a malicious server, and that could allow the attacker to gain code execution on the client.
OpenSSH for Windows
OpenSSH for Windows
Microsoft
Microsoft
Customer Action Required
Yes
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The ssh-pkcs11-helper.exe was configured to allow loading DLLs from a remote machine, even though it was only meant to use PKCS providers already installed locally.
Impact
An attacker could gain code execution on a client that connects to their malicious server, but only if the ssh-agent service was started with the special option and the user chose to connect.
What the attacker needed
Ssh-agent started with -Oallow-remote-pkcs11; victim connects to attacker's SSH server
The fix
The vulnerability was fixed by Microsoft, as indicated by the customer action required notice.
How it was found
- Start the ssh-agent service with the -Oallow-remote-pkcs11 option.
- Connect as a client to a server controlled by the attacker.
- The malicious server causes a malicious DLL to be loaded on the client.
- The loaded DLL executes code on the client machine.
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 report has not been written yet. The Original tab links to the source.
SSH is a way to log into another computer securely. The ssh-agent is a helper program that keeps your keys safe. This bug meant that if you connected to a bad server while using a special option, that server could make your computer run its own code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.