Rapid7 Vulnerability & Exploit Database

Themebleed- Windows 11 Themes Arbitrary Code Execution CVE-2023-38146

Back to Search

Themebleed- Windows 11 Themes Arbitrary Code Execution CVE-2023-38146

Disclosed
09/13/2023
Created
01/04/2024

Description

When an unpatched Windows 11 host loads a theme file referencing an msstyles file, Windows loads the msstyles file, and if that file's PACKME_VERSION is `999`, it then attempts to load an accompanying dll file ending in `_vrf.dll` Before loading that file, it verifies that the file is signed. It does this by opening the file for reading and verifying the signature before opening the file for execution. Because this action is performed in two discrete operations, it opens the procedure for a time of check to time of use vulnerability. By embedding a UNC file path to an SMB server we control, the SMB server can serve a legitimate, signed dll when queried for the read, but then serve a different file of the same name when the host intends to load/execute the dll.

Author(s)

  • gabe_k
  • bwatters-r7
  • Spencer McIntyre

Platform

Windows

Architectures

x64

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/windows/fileformat/theme_dll_hijack_cve_2023_38146
msf exploit(theme_dll_hijack_cve_2023_38146) > show targets
    ...targets...
msf exploit(theme_dll_hijack_cve_2023_38146) > set TARGET < target-id >
msf exploit(theme_dll_hijack_cve_2023_38146) > show options
    ...show and set options...
msf exploit(theme_dll_hijack_cve_2023_38146) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;