Back to list
Defense in depth -- the Microsoft way (part 53): our MSRC doesn't know how Windows handles PATH
Apr 09 2018 05:40PM
Stefan Kanthak (stefan kanthak nexgo de)
on their "Security Research & Defense" blog, members of Microsoft's
Security Response Center recently posted
This blog post but clearly shows that the MSRC doesn't know how Windows
handles the PATH!
| The directories that are in the PATH environment variable are always
| admin ACLed and a normal user can't modify contents of these directories.
| What Microsoft won't address (not a vulnerability)
| PATH directory scenarios - Since there can't be a non-admin directory in
| the PATH this can't be exploited.
The user can modify the PATH environment variable as s/he likes and add
1) Start a command prompt, then run the following commands:
START %ComSpec% /K PATH
2) The PATH environment variable is built during user logon from the
system's PATH, stored in the registry entry
plus the user's PATH, stored in the registry entry
To add one or more arbitrary user-controlled directories to this
persistent PATH, set the latter registry entry, for example via
When a user does this, control panel broadcasts a WM_SETTINGCHANGE
to all applications.
Especially Windows' File Explorer (the "shell") rebuilds the PATH
environment variable upon receiving this broadcast!
3) To add one or more arbitrary user-controlled directories to an
applications <filename.exe> PATH, create the registry entry
| 6. The directories that are listed in the PATH environment variable.
| Note that this does not include the per-application path specified
| by the App Paths registry key. The App Paths key is not used when
| computing the DLL search path.
The per-application path stored beneath the "App Paths" registry key is
prepended (NT 5.x and below) or appended (NT 6.x and above) to the PATH
environment variable when an application is started via one of the
| DLL planting issues that fall into the category of PATH directories
| DLL planting are treated as won't fix.
The MSRC also ignores the fact that
CHDIR "<arbitrary directory>"
is equivalent to adding "<arbitrary directory>" in front of the PATH!
JFTR: loading of DLLs from the CWD can be disabled via
[ reply ]
Copyright 2010, SecurityFocus