Skip to content
RCE Advisory Advanced CVE-2024-38029

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.

DarkNavy Follow

Originally disclosed on Microsoft

High 7.5 View original

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

The original report as published on the Microsoft Security Response Center, by DarkNavy. Images and videos are our own copies; raw HTML is shown as text. View it on Microsoft Security Response Center.

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

  1. Start the ssh-agent service with the -Oallow-remote-pkcs11 option.
  2. Connect as a client to a server controlled by the attacker.
  3. The malicious server causes a malicious DLL to be loaded on the client.
  4. 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.

More by DarkNavy

View all

4 more disclosed reports, best first.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.