Thursday, February 13, 2025

Analysis of a Flaw in Microsoft's Patch for "copy2pwn" (CVE-2024-38213)

This is a story of a temporarily flawed Microsoft patch.

CVE-2024-38213 is a vulnerability that causes files copied from WebDAV shared folders to Windows machine to not have the Mark of the Web (MotW) applied. This results in such files being overly trusted by Windows Explorer, Defender, SmartScreen and possibly other security products, and vulnerabilities like this are being exploited in the wild.

The vulnerability was discovered by security researcher Peter Girnus and Simon Zuckerbraun with the ZDI and reported to Microsoft, who provided a patch for it with July 2024 updates. Their advisory was, however, not released until August 2024, which was also when Peter published their detailed analysis. and nicknamed the vulnerability "copy2pwn".

We were naturally interested in the vulnerability as it was likely also affecting security-adopted legacy Windows systems for which Microsoft was no longer providing security patches.

Our review of Microsoft's patch, however, revealed something interesting:

It didn't work.


Analysis of the Flaw

CVE-2024-38213 manifests itself on a vulnerable Windows computer when we copy a file using Ctrl-C & Ctrl-V from a WebDAV share, or drag-and-dropping a file from such share. The latter results in a warning (Image 1), but both methods fail to flag the file with Mark of the Web (MotW).

 

Image 1: Security warning when drag-and-dropping a file from a network folder

 

For some reason, even a fully patched testing Windows computer was still behaving the same: no MotW on the copied file.

Analyzing Microsoft's patch, we found that the code for preventing exploitation of CVE-2024-38213 was there, but for some reason it didn't make a difference. Going further, we discovered that all Windows versions updated to August 2024, except Windows 11 and Server 2022, were still vulnerable.

Let's take a look at a relevant section of this code.

Image 2: _StampMotWonDestFileIfNeeded function

The _StampMotwOnDestFileIfNeeded function, added by the patch, has a very descriptive name when we consider CVE-2024-38213 and what it exploits. The function calls MapUrlToZone, based on which it should mark files with MotW when they come from the internet - but fails to do that. Halting execution with WinDbg we could see the execution flow went left (green arrow) after the first function code block (Image 2), which resulted in jumping to the exit block without setting the MotW.

This jump was caused by the compare instruction in the first block: cmp [rcx+89h], 0 so we wanted to know where the value at address rcx+89h came from. In situations like this, esReverse, a powerful reversing and binary analysis solution from eShard, saves the day. Its taint analysis functionality allowed us to take rcx+89h, track it through execution history, and quickly find all places where it was changed and by who. The taint path can traverse processes in case the data we're interested in gets sent from one process to another, tracing it all the way through the kernel.

 

Image 3: esReverse's Taint analysis window

We set up tainting from our current "transition" 447150053, to the very first transition as shown on Image 3. "Tag0" represents the data we're interested in tracing: 0xead25c9 is actually rcx+89h at the time of the execution entering function _StampMotwOnDestFileIfNeeded, and 1 is the number of bytes we care about at that location. Once we had the taint results, we analyzed all transitions and found that the last one was in the CTSTransfer constructor where rcx+89h location is initialized to 0. Then we needed to find the last change that affected location rcx+89h and caused the MotW logic in _StampMotwOnDestFileIfNeeded to be skipped.

Image 4: Instruction that sets the relevant variable to 0

The last executed instruction before _StampMotwOnDestFileIfNeeded compares the value at [rcx+89h] to 0 is: mov [rbx+89h], dil (Image 4) in the CTSTransfer constructor. We now only needed to find who sets the value of dil (the low 8 bytes of register rdi) and why.

Analyzing all transitions, we found the bug in function _InitializeZoneIdentifierInterfaces, called from the CTSTransfer constructor: when calling CoCreateInstance, the return value was compared to 0, and if equal, the function exited assuming CoCreateInstance had failed (Image 5).

 

Image 5: Return value of CoCreateInstance is compared to zero


But this is wrong: 0 is the value of S_OK, a.k.a. "Operation successful," while the code is treating it as an error.

We had our culprit! This bug in _InitializeZoneIdentifierInterfaces resulted in critical IInternetSecurityManager interface code being skipped, which left the interface uninitialized, resulting in _StampMotwOnDestFileIfNeeded determining that it could not use function MapUrlToZone - and deciding to bail out instead of setting a Mark of the Web on the copied file.

Fortunately, Microsoft must have also noticed this flaw and corrected it with the next Windows Update.

 

Image 6: comparison of fixed code (left) and flawed code (right)

Image 6 shows Microsoft's fix for this flaw. As is often the case, Microsoft's patch comes with a "patch switch" allowing for "enabling" the new code via a registry value. This makes sense in cases where the new code has a potential to cause functional problems so individual patches can be "turned off". We're not sure why this could be the case here (with the obvious programming error), but we appreciate the opportunity to show both pre-patch and post-patch code on the same image.

As you can see, the only difference between vulnerable pre-patch code and fixed post-patch code is in a single instruction: jz ("jump if zero") in pre-patch code results in erroring out when the call to CoCreateInstance succeeds (which is wrong), while js ("jump if signed", i.e., jump if negative) in post-patch code errors out when the call fails.


Our Micropatch

Our patch for legacy Windows systems - Windows 7, Server 2008 R2, and several Window 10 versions - was logically identical to Microsoft's (the corrected one, of course). This video shows it in action.


 
 

Vulnerabilities like this one get discovered on a regular basis, and attackers know about them all. If you're using Windows that aren't receiving official security updates anymore, 0patch will make sure these vulnerabilities won't be exploited on your computers - and you won't even have to know or care about these things.

If you're new to 0patch, create a free account in 0patch Central, then install and register 0patch Agent from 0patch.com, and email sales@0patch.com for a trial. Everything else will happen automatically. No computer reboot will be needed.

To learn more about 0patch, visit our Help Center

We'd like to thank Peter Girnus with the ZDI for sharing vulnerability details, which allowed us to reproduce it and create a micropatch. We also encourage all security researchers who want to see their vulnerabilities patched to share them with us or alert us about their publications.

Did you know 0patch will security-adopt Windows 10 as well as Office 2016 and Office 2019 when they all go out of support in October 2025, allowing you to keep using them for at least 5 more years? Read more about it here

Analysis was performed and written by our reverse engineering and patching expert Ziga Sumenjak.

Tuesday, February 11, 2025

Micropatches Released for Microsoft Outlook Remote Code Execution Vulnerability (CVE-2025-21357)

January 2025 Windows updates brought a fix for CVE-2025-21357, a remote code execution vulnerability in Microsoft Outlook. This vulnerability allows an attacker with access to the Exchange server with user's credentials to execute arbitrary code on user's computer when the user connects to Exchange with Outlook.

The vulnerability was reported to Microsoft by security researchers Jeongmin Choi, JongGeon KIM, Kiyeon Jeong, JunHyuk Im, and SeungYun LEE with bObffice (BOB13th), and Michael Gorelik and Arnold Osipov with Morphisec.

Michael Gorelik with Morphisec privately shared details and POC with us,which allowed us to reproduce the issue and create our own patches for security-adopted Outlook versions that are no longer receiving updates from Microsoft.

 

Microsoft's Patch

Microsoft patched this issue by initializing a previously uninitialized variable in the affected data structure to 0, preventing a previously possible invalid pointer dereference.

 

Our Micropatch

Our patch is logically equivalent to Microsoft's.


Micropatch Availability

Micropatches were written for the following security-adopted versions of Microsoft Office with all available Windows Updates installed:

  1. Microsoft Office 2010 - fully updated
  2. Microsoft Office 2013 - fully updated

 

Micropatches have already been distributed to, and applied on, all affected online computers with 0patch Agent in PRO or Enterprise accounts (unless Enterprise group settings prevented that). 

Vulnerabilities like these get discovered on a regular basis, and attackers know about them all. If you're using Windows that aren't receiving official security updates anymore, 0patch will make sure these vulnerabilities won't be exploited on your computers - and you won't even have to know or care about these things.

If you're new to 0patch, create a free account in 0patch Central, start a free trial, then install and register 0patch Agent. Everything else will happen automatically. No computer reboot will be needed.

We would like to thank Michael Gorelik with Morphisec for privately sharing details and POC with us, which made it possible for us to create a micropatch for this issue.

Did you know 0patch will security-adopt Windows 10 as well as Office 2016 and Office 2019 when they all go out of support in October 2025, allowing you to keep using them for at least 5 more years? Read more about it here.

To learn more about 0patch, please visit our Help Center.

Friday, February 7, 2025

Micropatches Released for Active Directory Certificate Services Elevation of Privilege Vulnerability (CVE-2024-49019)


November 2024 Windows updates brought a fix for CVE-2024-49019, a privilege escalation vulnerability allowing, under specific conditions, a domain user to create a certificate for another domain user, e.g., domain administrator - and then use it for logging in as that user.

The vulnerability was reported to Microsoft by security researchers Lou Scicchitano, Scot Berner, and Justin Bollinger with TrustedSec.

Justin then published a detailed article on this vulnerability,which allowed us to reproduce the issue and create our own patches for security-adopted Windows versions that are no longer receiving updates from Microsoft.

 

Microsoft's Patch

Microsoft patched this by adding a new function call that disables the Extended Key Usage attribute.

 

Our Micropatch

Our patch performs the same operation with additional optimizations to logic and code flow.


Micropatch Availability

Micropatches were written for the following security-adopted versions of Windows with all available Windows Updates installed:

  1. Windows Server 2008 R2 - - fully updated without ESU, with ESU 1, ESU 2, ESU 3 or ESU 4
  2. Windows Server 2012 - fully updated without ESU, with ESU 1
  3. Windows Server 2012 R2 - fully updated without ESU, with ESU 1

 

Only Windows Servers are affected by this issue.

Micropatches have already been distributed to, and applied on, all affected online computers with 0patch Agent in PRO or Enterprise accounts (unless Enterprise group settings prevented that). 

Vulnerabilities like these get discovered on a regular basis, and attackers know about them all. If you're using Windows that aren't receiving official security updates anymore, 0patch will make sure these vulnerabilities won't be exploited on your computers - and you won't even have to know or care about these things.

If you're new to 0patch, create a free account in 0patch Central, start a free trial, then install and register 0patch Agent. Everything else will happen automatically. No computer reboot will be needed.

We would like to thank researchers  Lou Scicchitano, Scot Berner, and Justin Bollinger with TrustedSec for publishing their analysis, which made it possible for us to create a micropatch for this issue.

Did you know 0patch will security-adopt Windows 10 when it goes out of support in October 2025, allowing you to keep using it for at least 5 more years? Read more about it here.

To learn more about 0patch, please visit our Help Center.

Micropatches Released for Windows OLE Remote Code Execution (CVE-2025-21298)

  

January 2025 Windows updates brought a fix for CVE-2025-21298, a memory corruption issue in Windows OLE data processing that can be exploited by a malicious Word document or a malicious email read in Outlook to execute arbitrary code on user's computer. (Probably also in multiple other ways, but these would be the obvious attack scenarios.)

The vulnerability was reported to Microsoft by security researchers Jmini, Rotiple, D4m0n with Trend Micro Zero Day Initiative.

Subsequently, security researcher Miloš published their analysis and POC of this vulnerability,which allowed us to reproduce the issue and create our own patches for security-adopted Windows versions that are no longer receiving updates from Microsoft.

 

Microsoft's Patch

The root cause of this issue is in function UtOlePresStmToContentsStm free'ing a stream object, but then storing the just free'd pointer which subsequently gets used again.

Microsoft patched this issue by overwriting the free's stream pointer with NULL, preventing its subsequent use.

 

Our Micropatch

Our patch does the exact same thing as Microsoft's.


Micropatch Availability

Micropatches were written for the following security-adopted versions of Windows with all available Windows Updates installed:

  1. Windows 11 v21H2 - fully updated
  2. Windows 10 v21H2 - fully updated
  3. Windows 10 v21H1 - fully updated
  4. Windows 10 v20H2 - fully updated
  5. Windows 10 v2004 - fully updated
  6. Windows 10 v1909 - fully updated
  7. Windows 10 v1809 - fully updated
  8. Windows 10 v1803 - fully updated
  9. Windows 7 - fully updated without ESU, with ESU 1, ESU 2 or ESU 3
  10. Windows Server 2008 R2 - - fully updated without ESU, with ESU 1, ESU 2, ESU 3 or ESU 4
  11. Windows Server 2012 - fully updated without ESU, with ESU 1
  12. Windows Server 2012 R2 - fully updated without ESU, with ESU 1

 

Micropatches have already been distributed to, and applied on, all affected online computers with 0patch Agent in PRO or Enterprise accounts (unless Enterprise group settings prevented that). 

Vulnerabilities like these get discovered on a regular basis, and attackers know about them all. If you're using Windows that aren't receiving official security updates anymore, 0patch will make sure these vulnerabilities won't be exploited on your computers - and you won't even have to know or care about these things.

If you're new to 0patch, create a free account in 0patch Central, start a free trial, then install and register 0patch Agent. Everything else will happen automatically. No computer reboot will be needed.

We would like to thank researchers Jmini, Rotiple, and D4m0n for sharing their finding with Microsoft, and security researcher MiloÅ¡ for publishing their analysis and POC, which made it possible for us to create a micropatch for this issue.

Did you know 0patch will security-adopt Windows 10 when it goes out of support in October 2025, allowing you to keep using it for at least 5 more years? Read more about it here.

To learn more about 0patch, please visit our Help Center.

Tuesday, February 4, 2025

Micropatches Released for Windows Task Scheduler Elevation of Privilege Vulnerability (CVE-2024-49039)

 

November 2024 Windows updates brought a fix for CVE-2024-49039, a local privilege escalation issue allowing low-integrity code running on the computer to execute arbitrary medium-integrity code as the same user. This can be useful for escaping low-integrity sandboxes such as those in modern web browsers (such as Mozilla Firefox) and document readers.

In short: if you are malicious code executed with low integrity, you create a scheduled task to be executed as you, then Task Scheduler executes this task with default (medium) integrity. Sandbox escaped.

The vulnerability was reported to Microsoft by the Mozilla Security Team, and by Vlad Stolyarov and Bahare Sabouri of Google's Threat Analysis Group.

Subsequently, security researcher je5442804 published their analysis and POC of this vulnerability,which allowed us to reproduce the issue and create our own patches for security-adopted Windows versions that are no longer receiving updates from Microsoft.

 

Microsoft's Patch

Microsoft patched this issue with new flags on the Task Scheduler RPC interface which prevents a low-integrity process from accessing it.

 

Our Micropatch

We decided to rather patch the TaskSchedulerCreateSchedule function, which is used to create the scheduled task. There, we check the requesting process's integrity before creating the task and deny the creation if the process has low integrity.


Micropatch Availability

Micropatches were written for the following security-adopted versions of Windows with all available Windows Updates installed:

  1. Windows 11 v21H2 - fully updated
  2. Windows 10 v21H2 - fully updated
  3. Windows 10 v21H1 - fully updated
  4. Windows 10 v20H2 - fully updated
  5. Windows 10 v2004 - fully updated
  6. Windows 10 v1909 - fully updated
  7. Windows 10 v1809 - fully updated
  8. Windows 10 v1803 - fully updated
The vulnerability was first introduced with Windows 10, therefore it does not exist on Windows 7, Windows Server 2008 and Windows Server 2012  (so no patches were needed there).

 Micropatches have already been distributed to, and applied on, all affected online computers with 0patch Agent in PRO or Enterprise accounts (unless Enterprise group settings prevented that). 

Vulnerabilities like these get discovered on a regular basis, and attackers know about them all. If you're using Windows that aren't receiving official security updates anymore, 0patch will make sure these vulnerabilities won't be exploited on your computers - and you won't even have to know or care about these things.

If you're new to 0patch, create a free account in 0patch Central, start a free trial, then install and register 0patch Agent. Everything else will happen automatically. No computer reboot will be needed.

We would like to thank je5442804 for sharing their analysis and POC, which made it possible for us to create a micropatch for this issue.

Did you know 0patch will security-adopt Windows 10 when it goes out of support in October 2025, allowing you to keep using it for at least 5 more years? Read more about it here.

To learn more about 0patch, please visit our Help Center.





Monday, February 3, 2025

Micropatches Released for NTLM Hash Disclosure Spoofing Vulnerability (CVE-2024-43451)

 

November 2024 Windows updates brought a fix for CVE-2024-43451, an NTLM hash disclosure vulnerability that allows an attacker to obtain user's Net-NTLM hash when the user right-clicks, deletes or moves a malicious .url file to another folder.

The vulnerability was reported to Microsoft by Israel Yeshurun with ClearSky Cyber Security, who subsequently also published a detailed report. The report allowed us to reproduce the issue and create our own patches for security-adopted Windows versions that are no longer receiving updates from Microsoft.

 

Microsoft's Patch

Microsoft patched this issue by replacing the IECreateFromPathCPWithBCW function with a new version that has an updated check for network paths. Multiple new tests are performed including calls to MapUrlToZone and IsFileURLW. They also added checks for special characters in the path, but all these additional checks were done to exclude some network paths (which Microsoft deemed legitimate) from being blocked.

 

Our Micropatch

As we could imagine no important real-world use of  letting .url files to automatically load resources from the Internet, we blocked this feature in its entirety by calling MapUrlToZone on the provided file path and only allowing requests from Trusted Sites zone, Local Intranet zone and Local Computer zone. This blocks all automatically triggered Internet resource requests from .url shortcut files without limiting these files' functionality.


Micropatch Availability

Micropatches were written for the following security-adopted versions of Windows with all available Windows Updates installed:

  1. Windows 11 v21H2 - fully updated
  2. Windows 10 v21H2 - fully updated
  3. Windows 10 v21H1 - fully updated
  4. Windows 10 v20H2 - fully updated
  5. Windows 10 v2004 - fully updated
  6. Windows 10 v1909 - fully updated
  7. Windows 10 v1809 - fully updated
  8. Windows 10 v1803 - fully updated
  9. Windows 7 - fully updated without ESU, or with ESU 1, ESU 2 or ESU 3
  10. Windows Server 2012, Server 2012 R2 - fully updated without ESU, or with ESU1
  11. Windows Server 2008 R2 - fully updated without ESU, or with ESU 1, ESU 2, ESU 3 or ESU 4
 
Micropatches have already been distributed to, and applied on, all affected online computers with 0patch Agent in PRO or Enterprise accounts (unless Enterprise group settings prevented that). 

Vulnerabilities like these get discovered on a regular basis, and attackers know about them all. If you're using Windows that aren't receiving official security updates anymore, 0patch will make sure these vulnerabilities won't be exploited on your computers - and you won't even have to know or care about these things.

If you're new to 0patch, create a free account in 0patch Central, start a free trial, then install and register 0patch Agent. Everything else will happen automatically. No computer reboot will be needed.

We would like to thank Israel Yeshurun with ClearSky Cyber Security for sharing their analysis, which made it possible for us to create a micropatch for this issue.

Did you know 0patch will security-adopt Windows 10 when it goes out of support in October 2025, allowing you to keep using it for at least 5 more years? Read more about it here.

To learn more about 0patch, please visit our Help Center.




Tuesday, January 14, 2025

Micropatches Released for Windows "LDAPNightmare" Denial of Service Vulnerability (CVE-2024-49113)


December 2024 Windows Updates brought a patch for CVE-2024-49113 a.k.a. "LDAPNightmare", a denial of service vulnerability in Windows LDAP client code. The vulnerability allows an attacker to crash the LDAP client process after coercing it to connect to their malicious LDAP server; if the client process happens to be an important Windows service such as lsass.exe, its crashing would lead to computer reboot.

The vulnerability was discovered and reported to Microsoft by security researcher Yuki Chen. After Microsoft's patch was issued, researchers Or Yair and Shahak Morag of SafeBreach reversed it, recreated a proof of concept, and issued a detailed analysis.

These allowed us to reproduce the issue and create our own patches for it for security-adopted Windows versions that are no longer receiving updates from Microsoft.

 

The Vulnerability

The vulnerability allows a malicious LDAP server to cause an out-of-bounds read operation in the memory space of the client process on the remote computer when processing LDAP referral data. This crashes said process, which can range from insignificant (when connecting to attacker's computer with a command-line LDAP app) to serious (when attacker coerces an important server to connect to their LDAP server, getting the server to crash as described in the SafeBreach article).

 

Microsoft's Patch

Microsoft patched this issue by comparing the server-supplied referral "index" to the size of the referral table in function LdapChaseReferral (wldap32.dll).

Our Micropatch

Our patch is functionally identical to Microsoft's.


Micropatch Availability

Micropatches were written for the following security-adopted versions of Windows with all available Windows Updates installed:

  1. Windows 11 v21H2 - fully updated
  2. Windows 10 v21H2 - fully updated
  3. Windows 10 v21H1 - fully updated
  4. Windows 10 v20H2 - fully updated
  5. Windows 10 v2004 - fully updated
  6. Windows 10 v1909 - fully updated
  7. Windows 10 v1809 - fully updated
  8. Windows 10 v1803 - fully updated
  9. Windows 7 - fully updated without ESU, or with ESU 1, ESU 2 or ESU 3
  10. Windows Server 2012, Server 2012 R2 - fully updated without ESU
  11. Windows Server 2008 R2 - fully updated without ESU, or with ESU 1, ESU 2, ESU 3 or ESU 4
 
Micropatches have already been distributed to, and applied on, all affected online computers with 0patch Agent in PRO or Enterprise accounts (unless Enterprise group settings prevented that). 

Vulnerabilities like these get discovered on a regular basis, and attackers know about them all. If you're using Windows that aren't receiving official security updates anymore, 0patch will make sure these vulnerabilities won't be exploited on your computers - and you won't even have to know or care about these things.

If you're new to 0patch, create a free account in 0patch Central, start a free trial, then install and register 0patch Agent. Everything else will happen automatically. No computer reboot will be needed.

We would like to thank Or Yair and Shahak Morag of SafeBreach for sharing their analysis and proof-of-concept, which made it possible for us to create a micropatch for this issue.Yuki Chen

To learn more about 0patch, please visit our Help Center.