(This issue is currently not fixed)
When handling long path names on network shares mapped to a drive,
thumbcache.
explorer.
An attacker would need to get a target user to open a specially crafted
folder in explorer.
To prevent explorer.details
:
view
tab at the top of the explorer.Details
from the list of ways to view the current folder.Options
on the right hand side of the view
banner.view
tab at the top.Apply to Folders
Launch folder windows in a separate
process
(The above steps are not required to trigger the issue AFAIK, but they make debugging easier.)
From a cmd.
> %SystemDrive%
> mkdir \test
> cd \test
> mkdir ___237_bytes_________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> cd ___237_bytes_________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> ECHO. >x. URL
> net share test=%SystemDrive%\test
> pushd \\localhost\test
> explorer. exe ___237_bytes_________________________________________________________________________________________________________________________________________________________________________________________________________________________________
At this point you may want to attach your debugger to the newly spawned
explorer.x
Internet Shortcut file: this should cause explorer.
When explorer.\\server\share
is mapped to drive Z:
and explorer.Z:\__long_path__...__\z.
, it will lookup the
thumbnail for \\server\share\__long_path__...__\x.
. When doing so, the
code at some point attempts to free this string. However, the string is part
of a struct and a pointer is located before this string, like so:
struct _ThumbNailStruct {
PVOID pUnknown;
WCHAR[] szFilePath;
};
This will cause the code to try to free a memory block using a pointer that is 4 (x86) or 8 (x64) bytes after the start of that block.
The size of the block can be controlled through the name of the server and share: chaning the length of the name for the server or share results in a similar change to the length of the path and thus the memory block.
The attacker does not appear to have control over the value in the pointer and the pointer is not aligned correctly, which is immediately detected by the heap manager. To my knowledge, this issue is not exploitable.
This is the first time I ran into this type of bug and therefore there was no code in BugId that handled it, which resulting in limited information being available for analysis. I have since added code to BugId that detects this issue and reports it correctly, as can be seen in the report near the end of this page.
Notice that Microsoft was not informed prior to releasing this information to
the public, as I do not believe this is a security issue that warrants a
private report. In the contrary: I believe that if people are experiencing
seemingly random crashes of explorer.
BugId: | MisalignedFree[0x212]+8 6c5. |
Location: | explorer. |
Description: | The application attempted to free memory using a pointer that was 8/0x8 bytes after a 530/0x212 byte heap block at address 0xB4EBDE0 |
Version: | explorer. thumbcache. |
Security impact: | Unknown: this type of bug has not been analyzed before |