Skip to content
RCE Write-up Advanced

DLL Hijacking Strikes Back: Exploiting Windows on ARM RDP Client (CVE-2023-24905)

The Windows on ARM RDP client loads a resource-only DLL from the current working directory, allowing an attacker to place a malicious DLL next to an RDP file. By including format string specifiers in the DLL's resources, an attacker could manipulate memory and potentially achieve remote code execution.

Dor Dali Follow

Published on cyolo.io

As technology advances and new devices with the latest operating systems are introduced, users have come to expect heightened security and improved performance. However, old vulnerabilities can still find their way into new systems, posing risks to users.

Dor Dali, on cyolo.io

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 the RDP client uses LoadLibraryExW with LOAD_WITH_ALTERED_SEARCH_PATH and a relative path beginning with a dot, causing the DLL to be loaded from the current working directory, and then uses strings from that DLL in a printf-style function without proper validation.

Impact

An attacker could achieve remote code execution on Windows on ARM devices, though the exploit was not fully developed and only affects ARM versions.

What the attacker needed

Windows on ARM device; victim opens a malicious RDP file; attacker places DLL and RDP file in a shared location

The fix

Microsoft released a security patch on May 9, 2023 to address the vulnerability.

How it was found

  1. Open an RDP file with the RDP client while monitoring with procmon to see it attempt to load fxsresm.dll from the current working directory.
  2. Create a DLL with a DllMain that runs calc.exe and place it next to the RDP file; observe that calc does not run because the DLL is loaded as a datafile.
  3. Use windbg to find the LoadLibraryExW call and note the flags LOAD_LIBRARY_AS_DATAFILE, LOAD_LIBRARY_AS_IMAGE_RESOURCE, and LOAD_WITH_ALTERED_SEARCH_PATH.
  4. Inspect the legitimate fxsresm.dll and find strings with format specifiers like %s and %u, indicating they are used in a printf-style function.
  5. Craft a malicious DLL containing harmful format strings and place it alongside a legitimate RDP file in a location the victim is likely to execute.

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.

When you open a file, Windows sometimes loads extra helper files called DLLs. This report found that on Windows ARM devices, the Remote Desktop program looks for a missing DLL in the same folder as the file you opened, not in the safe system folder. An attacker could put a fake DLL there, and because the program uses text from that DLL in a risky way, it might let the attacker run their 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 from Microsoft (Windows)

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.