mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add CodeQL suppressions for NativeCommandProcessor (#26729)
This commit is contained in:
@@ -831,6 +831,7 @@ namespace System.Management.Automation
|
||||
bool useSpecialArgumentPassing = UseSpecialArgumentPassing(oldFileName);
|
||||
if (useSpecialArgumentPassing)
|
||||
{
|
||||
// codeql[cs/microsoft/command-line-injection] - This is expected PowerShell behavior where user inputted paths are supported for the context of this method and the path portion of the argument is escaped. The user assumes trust for the file path specified on the user's system to start process for, and in the case of remoting, restricted remoting security guidelines should be used.
|
||||
startInfo.Arguments = "\"" + oldFileName + "\" " + startInfo.Arguments;
|
||||
}
|
||||
else
|
||||
@@ -855,7 +856,7 @@ namespace System.Management.Automation
|
||||
startInfo.ArgumentList.RemoveAt(0);
|
||||
}
|
||||
|
||||
// codeql[cs/microsoft/command-line-injection-shell-execution] - This is expected Poweshell behavior where user inputted paths are supported for the context of this method. The user assumes trust for the file path specified on the user's system to retrieve process info for, and in the case of remoting, restricted remoting security guidelines should be used.
|
||||
// codeql[cs/microsoft/command-line-injection-shell-execution] - This is expected PowerShell behavior where user inputted paths are supported for the context of this method. The user assumes trust for the file path specified on the user's system to retrieve process info for, and in the case of remoting, restricted remoting security guidelines should be used.
|
||||
startInfo.FileName = oldFileName;
|
||||
}
|
||||
}
|
||||
@@ -1607,7 +1608,7 @@ namespace System.Management.Automation
|
||||
{
|
||||
var startInfo = new ProcessStartInfo
|
||||
{
|
||||
// codeql[cs/microsoft/command-line-injection-shell-execution] - This is expected Poweshell behavior where user inputted paths are supported for the context of this method. The user assumes trust for the file path specified on the user's system to retrieve process info for, and in the case of remoting, restricted remoting security guidelines should be used.
|
||||
// codeql[cs/microsoft/command-line-injection-shell-execution] - This is expected PowerShell behavior where user inputted paths are supported for the context of this method. The user assumes trust for the file path specified on the user's system to retrieve process info for, and in the case of remoting, restricted remoting security guidelines should be used.
|
||||
FileName = this.Path
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user