You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merged PR 20126: Fix for partial PowerShell module search paths, that can be resolved to CWD locations (PowerShell#17231)
The problem is .NET will return empty strings for special folders that don't exist in some accounts (like System account), and the module path code appends path locations without first checking if the root path is non-empty. This results in partial paths in the PSModulePath list, which are then interpreted by .NET file APIs as rooted in the current working directory. And this in turn can allow low privilege users to drop modules in locations that higher privilege accounts will load from, thus gaining escalated privilege code execution.
These changes detect this non-rooted condition and prevents partial paths from being included in search lists.
Cherry picked from !17201
Co-authored-by: Travis Plunk <[email protected]>
0 commit comments